query fixes, avoid empty authors

This commit is contained in:
j 2014-05-27 20:10:55 +02:00
commit 1e082c3d1b
3 changed files with 14 additions and 5 deletions

View file

@ -60,7 +60,10 @@ def metadata(f, from_=None):
data['primaryid'] = ['asin', data['asin'][0]]
if 'author' in data:
if isinstance(data['author'], basestring):
data['author'] = data['author'].split('; ')
if data['author'].strip():
data['author'] = data['author'].strip().split('; ')
else:
del data['author']
if data['author'] in (['Administrator'], ['Default'], ['user']):
del data['author']
if not 'title' in data: