Fixes Uploading pdf file fails with whitespace title (#2824)
Merge remote-tracking branch 'pdf_title/fix/title-parsing-of-pdf-metadata'
This commit is contained in:
commit
ba0e5399d6
|
@ -88,7 +88,7 @@ def process(tmp_file_path, original_file_name, original_file_extension, rar_exec
|
||||||
log.warning('cannot parse metadata, using default: %s', ex)
|
log.warning('cannot parse metadata, using default: %s', ex)
|
||||||
|
|
||||||
if not meta.title.strip():
|
if not meta.title.strip():
|
||||||
meta = original_file_name
|
meta = meta._replace(title=original_file_name)
|
||||||
if not meta.author.strip() or meta.author.lower() == 'unknown':
|
if not meta.author.strip() or meta.author.lower() == 'unknown':
|
||||||
meta = meta._replace(author=_('Unknown'))
|
meta = meta._replace(author=_('Unknown'))
|
||||||
return meta
|
return meta
|
||||||
|
|
Loading…
Reference in New Issue
Block a user