I have a prototype with two new calibre: url endpoints:
- calibre://book-details/library/book_id
- calibre://book-details-search/library?q=search-query
Using either of these URLs will open a book details window getting the information from the named library, which doesn't need to be the current one. The current library isn't closed or changed, nor is the selection changed. In the first case, it gets the details for the book in the "other" library with the specified book id. In the second case it does a search on the other library and picks the first (one hopes the only) answer. A error is shown if either the book_id doesn't exist or the query matches no books.
The second form is useful for fields other than authors that don't support native links. See below.
Some examples:
Here is a "books" library. It makes reference to another library. Note the library name.
Here are the links in book details:
Clicking on the Publisher: Baen link opens a book details window with data from the other library. Again, note the library name.
Because only the authors field has native links I added a new formatter function to generate links to other libraries. This is the template that generated the links shown above:
Code:
program:
make_book_details_search_links(
'authors:Library.test_virtlib, publisher:Library.test_virtlib,', '<br>')
The first argument is a list of columns and associated libraries for which we want links. This example uses authors and publishers, both using the same target "other" library "Library.test_virtlib". For each column the function generates a comma-separated list of links. Each link is a book-details-query link looking for the value of the field in the other library. Each list is separated from the other by the second parameter, in this case '<br>'. As long as you accept the formatting, this function makes it very easy to generate links for any column, custom or standard.
While there I added the ability to have multiple book details windows. One window will move with book list changes. Other windows will keep their contents, regardless of source library. This image shows one example.
And yes, I know that at least some of you will ask for native links for all columns. I am thinking about this, but it introduces a *lot* of work for what seems to me to be minimal gain. It would require database changes, calibre API changes, and a UI to manage them. The click behavior of items in book details would change, I think for the worse. This is why I built the new template function, so a person can get interlibrary links while keeping the current click semantics.