cleanup meta parser
This commit is contained in:
parent
fc7b3ee049
commit
67d1814192
6 changed files with 49 additions and 6 deletions
|
|
@ -75,9 +75,17 @@ def lookup(id):
|
|||
del data['cover']
|
||||
|
||||
if 'author' in data:
|
||||
data['author'] = [data['author']]
|
||||
data['author'] = data['author'].split('; ')
|
||||
if 'title' in data:
|
||||
data['title'] = data['title'].replace(' : ', ': ')
|
||||
if 'publisher' in data:
|
||||
m = re.compile('(.+) : (.+), (\d{4})').findall(data['publisher'])
|
||||
if m:
|
||||
place, publisher, date = m[0]
|
||||
data['publisher'] = publisher
|
||||
data['date'] = date
|
||||
data['places'] = [place]
|
||||
|
||||
logger.debug('lookup %s => %s', id, data.keys())
|
||||
return data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue