mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'gh/pdf-metadata-fix' of https://github.com/aroig/calibre
This commit is contained in:
commit
8f655cd610
@ -95,7 +95,7 @@ def get_metadata(stream, cover=True):
|
||||
raw = f.read().strip()
|
||||
if raw:
|
||||
prints(raw)
|
||||
if not info:
|
||||
if info is None:
|
||||
raise ValueError('Could not read info dict from PDF')
|
||||
covpath = os.path.join(pdfpath, 'cover.jpg')
|
||||
cdata = None
|
||||
@ -103,7 +103,7 @@ def get_metadata(stream, cover=True):
|
||||
with open(covpath, 'rb') as f:
|
||||
cdata = f.read()
|
||||
|
||||
title = info.get('Title', None)
|
||||
title = info.get('Title', None) or _('Unknown')
|
||||
au = info.get('Author', None)
|
||||
if au is None:
|
||||
au = [_('Unknown')]
|
||||
|
Loading…
x
Reference in New Issue
Block a user