diff --git a/oml/item/scan.py b/oml/item/scan.py index ec6ccf4..9c87589 100644 --- a/oml/item/scan.py +++ b/oml/item/scan.py @@ -88,7 +88,7 @@ def run_scan(): if f.startswith('.'): continue f = os.path.join(root, f) - ext = f.split('.')[-1] + ext = f.split('.')[-1].lower() if ext == 'kepub': ext = 'epub' if ext in extensions: @@ -166,7 +166,7 @@ def run_import(options=None): if f.startswith('.'): continue f = os.path.join(root, f) - ext = f.split('.')[-1] + ext = f.split('.')[-1].lower() if ext in extensions: books.append(f) count += 1 diff --git a/oml/media/__init__.py b/oml/media/__init__.py index 32a92a8..266bc3c 100644 --- a/oml/media/__init__.py +++ b/oml/media/__init__.py @@ -28,7 +28,7 @@ def get_id(f=None, data=None): return base64.b32encode(codecs.decode(ox.sha1sum(f, cached=True), 'hex')).decode() def metadata(f, from_=None): - ext = f.split('.')[-1] + ext = f.split('.')[-1].lower() data = {} data['extension'] = ext data['size'] = os.stat(f).st_size