From 0030630453fa6efbcb7202bc56e740c266280b3f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Oct 2010 12:24:29 -0600 Subject: [PATCH] Fix #7114 (Problem with title in metadata download) --- src/calibre/ebooks/metadata/isbndb.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/calibre/ebooks/metadata/isbndb.py b/src/calibre/ebooks/metadata/isbndb.py index 07a054eeaa..83cf6ee0ed 100644 --- a/src/calibre/ebooks/metadata/isbndb.py +++ b/src/calibre/ebooks/metadata/isbndb.py @@ -45,7 +45,7 @@ def fetch_metadata(url, max=100, timeout=5.): class ISBNDBMetadata(Metadata): def __init__(self, book): - Metadata.__init__(self, None, []) + Metadata.__init__(self, None) def tostring(e): if not hasattr(e, 'string'): @@ -58,21 +58,21 @@ class ISBNDBMetadata(Metadata): return ans self.isbn = unicode(book.get('isbn13', book.get('isbn'))) - self.title = tostring(book.find('titlelong')) - if not self.title: - self.title = tostring(book.find('title')) - if not self.title: - self.title = _('Unknown') + title = tostring(book.find('titlelong')) + if not title: + title = tostring(book.find('title')) + self.title = title self.title = unicode(self.title).strip() - self.authors = [] + authors = [] au = tostring(book.find('authorstext')) if au: au = au.strip() temp = au.split(',') for au in temp: if not au: continue - self.authors.extend([a.strip() for a in au.split('&')]) - + authors.extend([a.strip() for a in au.split('&')]) + if authors: + self.authors = authors try: self.author_sort = tostring(book.find('authors').find('person')) if self.authors and self.author_sort == self.authors[0]: