dont add empty subtitle

This commit is contained in:
j 2016-01-09 16:11:04 +05:30
parent f57b75ac03
commit 094097b26d

View file

@ -63,7 +63,7 @@ def info(key, value):
'publishedDate': 'date', 'publishedDate': 'date',
}.get(key,key)] = _data[key] }.get(key,key)] = _data[key]
if 'subtitle' in _data: if 'subtitle' in _data and _data['subtitle'].strip():
data['title'] = '{title}: {subtitle}'.format(**_data) data['title'] = '{title}: {subtitle}'.format(**_data)
if r['items'][0]['accessInfo']['viewability'] != 'NO_PAGES': if r['items'][0]['accessInfo']['viewability'] != 'NO_PAGES':
data['cover'] = 'https://books.google.com/books?id=%s&pg=PP1&img=1&zoom=0&hl=en' % r['items'][0]['id'] data['cover'] = 'https://books.google.com/books?id=%s&pg=PP1&img=1&zoom=0&hl=en' % r['items'][0]['id']