mpv2oboeru

mpv helpers to create flashcards from movies and TV shows
git clone anongit@rnpnr.xyz:mpv2oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 1613dfd0d1c4cfb2a3887ebcc16e5e7775db762d
Parent: 148f103b45760b260d08efcbf1e83f2f1be8c439
Author: Ren Tatsumoto
Date:   Fri, 14 May 2021 00:35:16 +0300

support converting filenames to lowercase

Diffstat:
M.github/RELEASE/subs2srs.conf | 3+++
Msubs2srs.lua | 5+++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/.github/RELEASE/subs2srs.conf b/.github/RELEASE/subs2srs.conf @@ -68,6 +68,9 @@ tag_nuke_parentheses=no # Remove the episode number before substituting %n into tag tag_del_episode_num=yes +# Convert filename to lowercase for tagging. +tag_filename_lowercase=no + ################## # Image settings # ################## diff --git a/subs2srs.lua b/subs2srs.lua @@ -71,6 +71,7 @@ local config = { tag_nuke_brackets = true, -- delete all text inside brackets before subsituting filename into tag tag_nuke_parentheses = false, -- delete all text inside parentheses before subsituting filename into tag tag_del_episode_num = true, -- delete the episode number if found + tag_filename_lowercase = false, -- convert filename to lowercase for tagging. -- Misc info miscinfo_field = "Notes", -- misc notes and source information field @@ -333,6 +334,10 @@ local function tag_format(filename) filename = remove_filename_text_in_parentheses(filename) end + if config.tag_filename_lowercase == true then + filename = filename:lower() + end + filename = remove_leading_trailing_spaces(filename) filename = filename:gsub(" ", "_") filename = filename:gsub("_%-_", "_") -- Replaces garbage _-_ substrings with a underscore