| 1 |
.. _virtual_libraries: |
| 2 |
|
| 3 |
|
| 4 |
Virtual libraries |
| 5 |
============================ |
| 6 |
|
| 7 |
In calibre, a Virtual library is a way to tell calibre to open only a subset of a |
| 8 |
normal library. For example, you might want to only work with books by a certain |
| 9 |
author, or books having only a certain tag. Using Virtual libraries is the |
| 10 |
preferred way of partitioning your large book collection into smaller sub |
| 11 |
collections. It is superior to splitting up your library into multiple smaller |
| 12 |
libraries as, when you want to search through your entire collection, you can |
| 13 |
simply go back to the full library. There is no way to search through multiple |
| 14 |
separate libraries simultaneously in calibre. |
| 15 |
|
| 16 |
A Virtual library is different from a simple search. A search will only restrict |
| 17 |
the list of books shown in the book list. A Virtual library does that, and in |
| 18 |
addition it also restricts the entries shown in the :guilabel:`Tag browser` to |
| 19 |
the left. The Tag browser will only show tags, authors, series, publishers, etc. |
| 20 |
that come from the books in the Virtual library. A Virtual library thus behaves |
| 21 |
as though the actual library contains only the restricted set of books. |
| 22 |
|
| 23 |
Creating Virtual libraries |
| 24 |
---------------------------- |
| 25 |
|
| 26 |
.. |vlb| image:: images/virtual_library_button.png |
| 27 |
:class: float-left-img |
| 28 |
|
| 29 |
|vlb| To use a Virtual library click the :guilabel:`Virtual library` button located |
| 30 |
to the left of the Search bar and select the :guilabel:`Create Virtual library` |
| 31 |
option. As a first example, let's create a Virtual library that shows us only |
| 32 |
the books by a particular author. Click the :guilabel:`Authors` link as shown |
| 33 |
in the image below and choose the author you want to use and click OK. |
| 34 |
|
| 35 |
.. image:: images/vl_by_author.png |
| 36 |
:align: center |
| 37 |
|
| 38 |
The Create Virtual library dialog has been filled in for you. Click OK and you |
| 39 |
will see that a new Virtual library has been created, and automatically |
| 40 |
switched to, that displays only the books by the selected author. As far as |
| 41 |
calibre is concerned, it is as if your library contains only the books by the |
| 42 |
selected author. |
| 43 |
|
| 44 |
You can switch back to the full library at any time by once again clicking the |
| 45 |
:guilabel:`Virtual library` and selecting the entry named :guilabel:`<None>`. |
| 46 |
|
| 47 |
Virtual libraries are based on *searches*. You can use any search as the |
| 48 |
basis of a Virtual library. The Virtual library will contain only the |
| 49 |
books matched by that search. First, type in the search you want to use |
| 50 |
in the Search bar or build a search using the :guilabel:`Tag browser`. |
| 51 |
When you are happy with the returned results, click the :guilabel:`Virtual library` |
| 52 |
button, choose :guilabel:`Create library` and enter a name for the new Virtual |
| 53 |
library. The Virtual library will then be created based on the search |
| 54 |
you just typed in. Searches are very powerful, for examples of the kinds |
| 55 |
of things you can do with them, see :ref:`search_interface`. |
| 56 |
|
| 57 |
Examples of useful Virtual libraries |
| 58 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 59 |
|
| 60 |
* Books added to calibre in the last day:: |
| 61 |
date:>1daysago |
| 62 |
* Books added to calibre in the last month:: |
| 63 |
date:>30daysago |
| 64 |
* Books with a rating of 5 stars:: |
| 65 |
rating:5 |
| 66 |
* Books with a rating of at least 4 stars:: |
| 67 |
rating:>=4 |
| 68 |
* Books with no rating:: |
| 69 |
rating:false |
| 70 |
* Periodicals downloaded by the Fetch News function in calibre:: |
| 71 |
tags:=News and author:=calibre |
| 72 |
* Books with no tags:: |
| 73 |
tags:false |
| 74 |
* Books with no covers:: |
| 75 |
cover:false |
| 76 |
|
| 77 |
Working with Virtual libraries |
| 78 |
------------------------------------- |
| 79 |
|
| 80 |
You can edit a previously created Virtual library or remove it, by clicking the |
| 81 |
:guilabel:`Virtual library` and choosing the appropriate action. |
| 82 |
|
| 83 |
You can tell calibre that you always want to apply a particular Virtual library |
| 84 |
when the current library is opened, by going to |
| 85 |
:guilabel:`Preferences->Interface->Behavior`. |
| 86 |
|
| 87 |
You can quickly use the current search as a temporary Virtual library by |
| 88 |
clicking the :guilabel:`Virtual library` button and choosing the |
| 89 |
:guilabel:`*current search` entry. |
| 90 |
|
| 91 |
You can display all available Virtual libraries as tabs above the book list. |
| 92 |
This is particularly handy if you like switching between Virtual libraries very |
| 93 |
often. Click the :guilabel:`Virtual library` button and select :guilabel:`Show |
| 94 |
Virtual libraries as tabs`. You can re-arrange the tabs by drag and drop and |
| 95 |
close ones you do not want to see. Closed tabs can be restored by |
| 96 |
right-clicking on the tab bar. |
| 97 |
|
| 98 |
Using Virtual libraries in searches |
| 99 |
------------------------------------- |
| 100 |
|
| 101 |
You can search for books that are in a Virtual library using the ``vl:`` prefix. For |
| 102 |
example, ``vl:Read`` will find all the books in the *Read* Virtual library. The search |
| 103 |
``vl:Read and vl:"Science Fiction"`` will find all the books that are in both the *Read* and |
| 104 |
*Science Fiction* Virtual libraries. |
| 105 |
|
| 106 |
The value following ``vl:`` must be the name of a Virtual library. If the Virtual library name |
| 107 |
contains spaces then surround it with quotes. |
| 108 |
|
| 109 |
One use for a Virtual library search is in the Content server. In |
| 110 |
:guilabel:`Preferences->Sharing over the net->Require username and password` you |
| 111 |
can limit the calibre libraries visible to a user. For each visible library you |
| 112 |
can specify a search expression to further limit which books are seen. Use |
| 113 |
``vl:"Virtual library name"`` to limit the books to those in a Virtual library. |
| 114 |
|
| 115 |
Using additional restrictions |
| 116 |
------------------------------- |
| 117 |
|
| 118 |
You can further restrict the books shown in a Virtual library by using |
| 119 |
:guilabel:`Additional restrictions`. An additional restriction is a saved search |
| 120 |
you previously created that can be applied to the current Virtual library to |
| 121 |
further restrict the books shown in a Virtual library. For example, say you |
| 122 |
have a Virtual library for books tagged as :guilabel:`Historical Fiction` and a |
| 123 |
saved search that shows you unread books, you can click the :guilabel:`Virtual |
| 124 |
Library` button and choose the :guilabel:`Additional restriction` option to |
| 125 |
show only unread Historical Fiction books. To learn about saved searches, see |
| 126 |
:ref:`saved_searches`. |