make extension lower case
This commit is contained in:
parent
44515eb031
commit
209ebeaab8
2 changed files with 3 additions and 3 deletions
|
@ -88,7 +88,7 @@ def run_scan():
|
||||||
if f.startswith('.'):
|
if f.startswith('.'):
|
||||||
continue
|
continue
|
||||||
f = os.path.join(root, f)
|
f = os.path.join(root, f)
|
||||||
ext = f.split('.')[-1]
|
ext = f.split('.')[-1].lower()
|
||||||
if ext == 'kepub':
|
if ext == 'kepub':
|
||||||
ext = 'epub'
|
ext = 'epub'
|
||||||
if ext in extensions:
|
if ext in extensions:
|
||||||
|
@ -166,7 +166,7 @@ def run_import(options=None):
|
||||||
if f.startswith('.'):
|
if f.startswith('.'):
|
||||||
continue
|
continue
|
||||||
f = os.path.join(root, f)
|
f = os.path.join(root, f)
|
||||||
ext = f.split('.')[-1]
|
ext = f.split('.')[-1].lower()
|
||||||
if ext in extensions:
|
if ext in extensions:
|
||||||
books.append(f)
|
books.append(f)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
|
@ -28,7 +28,7 @@ def get_id(f=None, data=None):
|
||||||
return base64.b32encode(codecs.decode(ox.sha1sum(f, cached=True), 'hex')).decode()
|
return base64.b32encode(codecs.decode(ox.sha1sum(f, cached=True), 'hex')).decode()
|
||||||
|
|
||||||
def metadata(f, from_=None):
|
def metadata(f, from_=None):
|
||||||
ext = f.split('.')[-1]
|
ext = f.split('.')[-1].lower()
|
||||||
data = {}
|
data = {}
|
||||||
data['extension'] = ext
|
data['extension'] = ext
|
||||||
data['size'] = os.stat(f).st_size
|
data['size'] = os.stat(f).st_size
|
||||||
|
|
Loading…
Reference in a new issue