fix cbz import

This commit is contained in:
j 2016-02-18 20:35:54 +05:30
parent 84259fb0c4
commit a9d33dd2d8

View file

@ -34,7 +34,7 @@ def metadata(f, from_=None):
data['size'] = os.stat(f).st_size data['size'] = os.stat(f).st_size
try: try:
if ext == 'cbr': if ext in ('cbr', 'cbz'):
info = cbr.info(f) info = cbr.info(f)
elif ext in ('epub', 'kepub'): elif ext in ('epub', 'kepub'):
info = epub.info(f) info = epub.info(f)
@ -43,6 +43,9 @@ def metadata(f, from_=None):
info = pdf.info(f) info = pdf.info(f)
elif ext == 'txt': elif ext == 'txt':
info = txt.info(f) info = txt.info(f)
else:
logger.error('unknown extension %s', f, ext)
info = {}
except: except:
logger.debug('failed to load %s info from %s', ext, f, exc_info=True) logger.debug('failed to load %s info from %s', ext, f, exc_info=True)
info = {} info = {}