ISBNDb metadata plugin: Fix bug causing only first page of results to be fetched

This commit is contained in:
Kovid Goyal 2010-06-26 11:42:36 -06:00
parent 5c62b43d94
commit 3f14bedb00
2 changed files with 7 additions and 5 deletions

View File

@ -273,6 +273,7 @@ def filter_metadata_results(item):
def do_cover_check(item):
item.has_cover = False
if item.isbn:
try:
item.has_cover = check_for_cover(item.isbn)
except:

View File

@ -34,7 +34,8 @@ def fetch_metadata(url, max=100, timeout=5.):
errmsg = soup.find('errormessage').string
raise ISBNDBError('Error fetching metadata: '+errmsg)
total_results = int(book_list['total_results'])
np = '&page_number=%s&'%(page_number+1)
page_number += 1
np = '&page_number=%s&'%page_number
url = re.sub(r'\&page_number=\d+\&', np, url)
books.extend(book_list.findAll('bookdata'))
max -= 1