1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-10 04:03:00 +00:00

Improved error handling for renaming authors and titles (changes related to filesystem and not only to database)

This commit is contained in:
OzzieIsaacs
2017-11-30 16:49:46 +01:00
parent b4aede78bc
commit f1fac28203
18 changed files with 1249 additions and 1124 deletions

View File

@@ -49,8 +49,8 @@ def process(tmp_file_path, original_file_name, original_file_extension):
meta = epub.get_epub_info(tmp_file_path, original_file_name, original_file_extension)
if ".FB2" == original_file_extension.upper() and use_fb2_meta is True:
meta = fb2.get_fb2_info(tmp_file_path, original_file_extension)
except Exception as e:
logger.warning('cannot parse metadata, using default: %s', e)
except Exception as ex:
logger.warning('cannot parse metadata, using default: %s', ex)
if meta and meta.title.strip() and meta.author.strip():
return meta
@@ -111,6 +111,7 @@ def pdf_preview(tmp_file_path, tmp_dir):
img.save(filename=os.path.join(tmp_dir, cover_file_name))
return cover_file_name
def get_versions():
if not use_generic_pdf_cover:
IVersion=ImageVersion.MAGICK_VERSION
@@ -120,4 +121,4 @@ def get_versions():
PVersion=PyPdfVersion
else:
PVersion=_(u'not installed')
return {'ImageVersion':IVersion,'PyPdfVersion':PVersion}
return {'ImageVersion': IVersion, 'PyPdfVersion': PVersion}