turns out some records in googlebooks have no title!
https://www.googleapis.com/books/v1/volumes/?q=isbn:9780867130768pull/1/head
parent
f9de2d229f
commit
6215a7c8d8
|
@ -138,7 +138,10 @@ def update_edition(edition):
|
||||||
item=results['items'][0]
|
item=results['items'][0]
|
||||||
googlebooks_id=item['id']
|
googlebooks_id=item['id']
|
||||||
d = item['volumeInfo']
|
d = item['volumeInfo']
|
||||||
|
if d.has_key('title'):
|
||||||
title = d['title']
|
title = d['title']
|
||||||
|
else:
|
||||||
|
title=''
|
||||||
if len(title)==0:
|
if len(title)==0:
|
||||||
# need a title to make an edition record; some crap records in GB. use title from parent if available
|
# need a title to make an edition record; some crap records in GB. use title from parent if available
|
||||||
title=edition.work.title
|
title=edition.work.title
|
||||||
|
@ -249,7 +252,10 @@ def add_by_googlebooks_id(googlebooks_id, work=None, results=None, isbn=None):
|
||||||
item = _get_json(url)
|
item = _get_json(url)
|
||||||
d = item['volumeInfo']
|
d = item['volumeInfo']
|
||||||
|
|
||||||
|
if d.has_key('title'):
|
||||||
title = d['title']
|
title = d['title']
|
||||||
|
else:
|
||||||
|
title=''
|
||||||
if len(title)==0:
|
if len(title)==0:
|
||||||
# need a title to make an edition record; some crap records in GB. use title from parent if available
|
# need a title to make an edition record; some crap records in GB. use title from parent if available
|
||||||
if work:
|
if work:
|
||||||
|
|
Loading…
Reference in New Issue