Fix regression taht broke fetching metadata from isbndb.com

This commit is contained in:
Kovid Goyal 2010-09-29 16:02:13 -06:00
parent aa410bcdef
commit 6bad744fac

View File

@ -47,10 +47,10 @@ class ISBNDBMetadata(Metadata):
def __init__(self, book): def __init__(self, book):
Metadata.__init__(self, None, []) Metadata.__init__(self, None, [])
self.isbn = book.get('isbn13', book.get('isbn')) self.isbn = unicode(book.get('isbn13', book.get('isbn')))
self.title = book.find('titlelong').string self.title = unicode(book.find('titlelong').string)
if not self.title: if not self.title:
self.title = book.find('title').string self.title = unicode(book.find('title').string)
self.title = unicode(self.title).strip() self.title = unicode(self.title).strip()
au = unicode(book.find('authorstext').string).strip() au = unicode(book.find('authorstext').string).strip()
temp = au.split(',') temp = au.split(',')
@ -65,11 +65,11 @@ class ISBNDBMetadata(Metadata):
self.author_sort = None self.author_sort = None
except: except:
pass pass
self.publisher = book.find('publishertext').string self.publisher = unicode(book.find('publishertext').string)
summ = book.find('summary') summ = book.find('summary')
if summ and hasattr(summ, 'string') and summ.string: if summ and hasattr(summ, 'string') and summ.string:
self.comments = 'SUMMARY:\n'+summ.string self.comments = 'SUMMARY:\n'+unicode(summ.string)
def build_isbn(base_url, opts): def build_isbn(base_url, opts):