mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Merge branch 'master' of https://github.com/lewixliu/calibre
This commit is contained in:
commit
31b451d4f3
@ -85,7 +85,7 @@ class Douban(Source):
|
|||||||
description = entry_.get('summary')
|
description = entry_.get('summary')
|
||||||
# subtitle = entry_.get('subtitle') # TODO: std metada doesn't have this field
|
# subtitle = entry_.get('subtitle') # TODO: std metada doesn't have this field
|
||||||
publisher = entry_.get('publisher')
|
publisher = entry_.get('publisher')
|
||||||
isbns = entry_.get('isbn13') # ISBN11 is obsolute, use ISBN13
|
isbn = entry_.get('isbn13') # ISBN11 is obsolute, use ISBN13
|
||||||
pubdate = entry_.get('pubdate')
|
pubdate = entry_.get('pubdate')
|
||||||
authors = entry_.get('author')
|
authors = entry_.get('author')
|
||||||
book_tags = entry_.get('tags')
|
book_tags = entry_.get('tags')
|
||||||
@ -106,7 +106,12 @@ class Douban(Source):
|
|||||||
# mi.subtitle = subtitle
|
# mi.subtitle = subtitle
|
||||||
|
|
||||||
# ISBN
|
# ISBN
|
||||||
for x in isbns:
|
isbns = []
|
||||||
|
if isinstance(isbn, basestring):
|
||||||
|
if check_isbn(isbn):
|
||||||
|
isbns.append(isbn)
|
||||||
|
else:
|
||||||
|
for x in isbn:
|
||||||
if check_isbn(x):
|
if check_isbn(x):
|
||||||
isbns.append(x)
|
isbns.append(x)
|
||||||
if isbns:
|
if isbns:
|
||||||
@ -335,10 +340,15 @@ class Douban(Source):
|
|||||||
log.exception('Failed to make identify query: %r' % query)
|
log.exception('Failed to make identify query: %r' % query)
|
||||||
return as_unicode(e)
|
return as_unicode(e)
|
||||||
try:
|
try:
|
||||||
entries = json.loads(raw)['books']
|
j = json.loads(raw)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception('Failed to parse identify results')
|
log.exception('Failed to parse identify results')
|
||||||
return as_unicode(e)
|
return as_unicode(e)
|
||||||
|
if j.has_key('books'):
|
||||||
|
entries = j['books']
|
||||||
|
else:
|
||||||
|
entries = []
|
||||||
|
entries.append(j)
|
||||||
if not entries and identifiers and title and authors and \
|
if not entries and identifiers and title and authors and \
|
||||||
not abort.is_set():
|
not abort.is_set():
|
||||||
return self.identify(
|
return self.identify(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user