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: 12c00cf757213141daceda456074f8bc037f1bd4
Parent: 4209367a1035e3529e89c5f95bc9bc7951a6dba1
Author: Marko Leinikka
Date:   Tue, 29 Mar 2022 20:24:05 +0300

fix get_episode_number picking up digits in hashes

For example it picked up the E495 here, not 06: "Sono Bisque Doll wa Koi wo Suru - 06 [54E495D0]"

Diffstat:
Msubs2srs.lua | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -368,7 +368,8 @@ local function get_episode_number(filename) local filename_reversed = filename:reverse() local ep_num_patterns = { - "%s?(%d?%d?%d)[pP]?[eE]", -- Starting with E or EP (case-insensitive). "Example Series S01E01" + "[%s_](%d?%d?%d)[pP]?[eE]", -- Starting with E or EP (case-insensitive). "Example Series S01E01 [94Z295D1]" + "^(%d?%d?%d)[pP]?[eE]", -- Starting with E or EP (case-insensitive) at the end of filename. "Example Series S01E01" "%)(%d?%d?%d)%(", -- Surrounded by parentheses. "Example Series (12)" "%](%d?%d?%d)%[", -- Surrounded by brackets. "Example Series [01]" "%s(%d?%d?%d)%s", -- Surrounded by whitespace. "Example Series 124 [1080p 10-bit]"