mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
When using calibre://show-book URLs and the book is not found, clear any Virtual library or search restriction and then show the book. Fixes #1905113 [Clear current VL when using calibre:// to show book (or add switch VL modifier)](https://bugs.launchpad.net/calibre/+bug/1905113)
This commit is contained in:
parent
80aaffa6ef
commit
31c7ef4167
@ -404,7 +404,7 @@ class SearchRestrictionMixin(object):
|
||||
|
||||
current_lib = db.data.get_base_restriction_name()
|
||||
|
||||
if current_lib == '':
|
||||
if not current_lib:
|
||||
a = m.addAction(self.checked, self.no_restriction)
|
||||
else:
|
||||
a = m.addAction(self.empty, self.no_restriction)
|
||||
@ -576,7 +576,7 @@ class SearchRestrictionMixin(object):
|
||||
self.search_restriction.setCurrentIndex(index)
|
||||
self.apply_search_restriction(index)
|
||||
|
||||
def apply_named_search_restriction(self, name):
|
||||
def apply_named_search_restriction(self, name=None):
|
||||
if not self.search_restriction_list_built:
|
||||
self.build_search_restriction_list()
|
||||
if not name:
|
||||
|
@ -671,7 +671,12 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
return
|
||||
|
||||
def doit():
|
||||
self.library_view.select_rows((book_id,))
|
||||
rows = self.library_view.select_rows((book_id,))
|
||||
db = self.current_db
|
||||
if not rows and (db.data.get_base_restriction_name() or db.data.get_search_restriction_name()):
|
||||
self.apply_virtual_library()
|
||||
self.apply_named_search_restriction()
|
||||
self.library_view.select_rows((book_id,))
|
||||
|
||||
self.perform_url_action(library_id, library_path, doit)
|
||||
elif action == 'view-book':
|
||||
|
Loading…
x
Reference in New Issue
Block a user