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.
This commit is contained in:
lamusmaser 2023-07-27 08:01:53 -06:00 committed by GitHub
parent cd25eadd1c
commit 865089d46d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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