Fallback to keywords if there is no keyword

This commit is contained in:
Kovid Goyal 2019-09-17 09:10:51 +05:30
parent 6e0dd65885
commit 2336168f00
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -179,8 +179,9 @@ def get_metadata(stream, extract_cover=True):
mi.comments = data['description'] mi.comments = data['description']
if 'language' in data: if 'language' in data:
mi.language = data['language'] mi.language = data['language']
if data.get('keyword', ''): kw = data.get('keyword') or data.get('keywords')
mi.tags = [x.strip() for x in data['keyword'].split(',') if x.strip()] if kw:
mi.tags = [x.strip() for x in kw.split(',') if x.strip()]
opfmeta = False # we need this later for the cover opfmeta = False # we need this later for the cover
opfnocover = False opfnocover = False
if data.get('opf.metadata','') == 'true': if data.get('opf.metadata','') == 'true':