From 865089d46db93c62b03d04fcbf7fbcadacb7b357 Mon Sep 17 00:00:00 2001 From: lamusmaser <1940060+lamusmaser@users.noreply.github.com> Date: Thu, 27 Jul 2023 08:01:53 -0600 Subject: [PATCH] Resolve #502 by making the extension lowercase before comparison. (#504) * Resolve #502 with making the extension lowercase. Add note to `EXT_MAP` reference. * Fixed comment for linting, added more details. --- tubearchivist/home/src/index/manual.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index/manual.py b/tubearchivist/home/src/index/manual.py index 66b6bca..3a19588 100644 --- a/tubearchivist/home/src/index/manual.py +++ b/tubearchivist/home/src/index/manual.py @@ -31,6 +31,9 @@ class ImportFolderScanner: CACHE_DIR = CONFIG["application"]["cache_dir"] IMPORT_DIR = os.path.join(CACHE_DIR, "import") + """All extensions should be in lowercase until better handling is in place. + Described in Issue #502. + """ EXT_MAP = { "media": [".mp4", ".mkv", ".webm"], "metadata": [".json"], @@ -118,7 +121,7 @@ class ImportFolderScanner: """detect metadata type for file""" for key, value in self.EXT_MAP.items(): - if ext in value: + if ext.lower() in value: return key, file_path return False, False