mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Fix OpenLibrary plugin so it excludes empty books.
This commit is contained in:
parent
f8e44976e1
commit
568b79c018
@ -50,6 +50,9 @@ class OpenLibraryStore(BasicStoreConfig, StorePlugin):
|
||||
if counter <= 0:
|
||||
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'))
|
||||
if not id:
|
||||
continue
|
||||
@ -67,7 +70,7 @@ class OpenLibraryStore(BasicStoreConfig, StorePlugin):
|
||||
s.author = author.strip()
|
||||
s.price = price
|
||||
s.detail_item = id.strip()
|
||||
s.drm = SearchResult.DRM_UNKNOWN
|
||||
s.drm = SearchResult.DRM_UNLOCKED
|
||||
|
||||
yield s
|
||||
|
||||
|
@ -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():
|
||||
self.pi.stopAnimation()
|
||||
else:
|
||||
self.pi.startAnimation()
|
||||
if not self.pi.isAnimated():
|
||||
self.pi.startAnimation()
|
||||
|
||||
def get_store_checks(self):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user