kovidgoyal/calibre — pull request #36 by cbhaley (2013-07-12 15:33:39+00:00)
Title: Add template function returning virtual libraries book is a member of

Added 'stuff' to support a template function returning the names of the virtual libraries that the book is a member of. If the user wants to see this information, s/he creates a composite column (like tags) with the template
{0:'book_in_virtual_libraries()'}
If the column is marked "show in tag browser" then a category will be built showing each VL name.

Very little processing is done if the function is not used.

On my 2000-book test library with 2 virtual simple libraries defined, starting up with the composite column takes 5.25 seconds, and without 5.23 seconds. Of course, the time required will depend on the complexity of the VL search and the number of VLs.

The function will run only in the library view. It will not work in save- and send- templates. If the user wants to use the information in those templates then s/he must create the composite column.

I am still testing this stuff, but I wanted to pass it by you in case you had objections or improvements.