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:
|
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
|
||||||
|
|
||||||
|
@ -214,6 +214,7 @@ 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:
|
||||||
|
if not self.pi.isAnimated():
|
||||||
self.pi.startAnimation()
|
self.pi.startAnimation()
|
||||||
|
|
||||||
def get_store_checks(self):
|
def get_store_checks(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user