Store: Fix OpenLibrary plugin so it excludes empty books.

This commit is contained in:
John Schember 2011-04-22 23:02:50 -04:00
parent f8e44976e1
commit 568b79c018
2 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,9 @@ class OpenLibraryStore(BasicStoreConfig, StorePlugin):
if counter <= 0: if counter <= 0:
break break
# Don't include books that don't have downloadable files.
if not data.xpath('boolean(./span[@class="actions"]//span[@class="label" and contains(text(), "Read")])'):
continue
id = ''.join(data.xpath('./span[@class="bookcover"]/a/@href')) id = ''.join(data.xpath('./span[@class="bookcover"]/a/@href'))
if not id: if not id:
continue continue
@ -67,7 +70,7 @@ class OpenLibraryStore(BasicStoreConfig, StorePlugin):
s.author = author.strip() s.author = author.strip()
s.price = price s.price = price
s.detail_item = id.strip() s.detail_item = id.strip()
s.drm = SearchResult.DRM_UNKNOWN s.drm = SearchResult.DRM_UNLOCKED
yield s yield s

View File

@ -214,7 +214,8 @@ class SearchDialog(QDialog, Ui_Dialog):
if not self.search_pool.threads_running() and not self.results_view.model().cover_pool.threads_running() and not self.results_view.model().details_pool.threads_running(): if not self.search_pool.threads_running() and not self.results_view.model().cover_pool.threads_running() and not self.results_view.model().details_pool.threads_running():
self.pi.stopAnimation() self.pi.stopAnimation()
else: else:
self.pi.startAnimation() if not self.pi.isAnimated():
self.pi.startAnimation()
def get_store_checks(self): def get_store_checks(self):
''' '''