From 669eb3702873d75ef13fc422ab9bed30d882ad49 Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 11 Mar 2024 12:37:24 -0400 Subject: [PATCH 1/2] expand front/back cover regexes --- dlibrary/dlibrary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index cf8b69b..6344f9b 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -47,8 +47,8 @@ LANGUAGE_REGEXES = { } TEXTLESS_REGEX = re.compile('(台詞|セリフ|せりふ|テキスト|文字)((な|無)し|抜き)|notext|textless', re.I) -FRONT_COVER_REGEX = re.compile('(^|[^裏])表紙|cover|hyoushi', re.I) -BACK_COVER_REGEX = re.compile('裏表紙', re.I) +FRONT_COVER_REGEX = re.compile('(? Date: Mon, 11 Mar 2024 12:44:06 -0400 Subject: [PATCH 2/2] ignore directories that don't contain any files we care about --- dlibrary/dlibrary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 6344f9b..a08ccbc 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -266,6 +266,8 @@ class Collator: self.index = 0 def collate_from_paths(self, srcs): + srcs = [src for src in srcs if len(descendant_files_ignore(src, self.exclude)) > 0] + if len(srcs) == 1 and srcs[0].is_dir(): return self.collate_from_paths(ls_ignore(srcs[0], self.exclude))