mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow controlling the Virtual library with calibre://search URLs
This commit is contained in:
parent
31c7ef4167
commit
7ebfb0f248
@ -81,6 +81,18 @@ search expression is complicated, :ref:`encode it as a hex string <hex_encoding>
|
||||
and use ``eq`` instead. Leaving out the query will cause the current search to
|
||||
be cleared.
|
||||
|
||||
By default, if a Virtual library is selected, calibre will clear it before
|
||||
doing the search to ensure all books are found. If you want to preserve the
|
||||
Virtual library, use::
|
||||
|
||||
calibre://search/Library_Name?q=query&virtual_library=_
|
||||
|
||||
If you want to switch to a particular Virtual library, use::
|
||||
|
||||
calibre://search/Library_Name?virtual_library=Library%20Name
|
||||
|
||||
replacing spaces in the Virtual library name by ``%20``.
|
||||
|
||||
|
||||
.. _hex_encoding:
|
||||
|
||||
|
@ -718,8 +718,13 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
if sq:
|
||||
sq = sq[0]
|
||||
sq = sq or ''
|
||||
vl = (query.get('virtual_library') or ['-'])[0]
|
||||
if vl == '-':
|
||||
vl = None
|
||||
|
||||
def doit():
|
||||
if vl != '_':
|
||||
self.apply_virtual_library(vl)
|
||||
self.search.set_search_string(sq)
|
||||
self.perform_url_action(library_id, library_path, doit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user