View Single Post
Old 09-20-2020, 01:29 PM   #12
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by JimmXinu View Post
Alternative idea: Is there, or could there be, a template function that returns a device name? Then a custom column-from-columns could use the function to make it available in searches?
Well isn't this a coincidence.

I was playing today and wrote a new template function that returns a comma-separated set of colon-separated items, like identifiers. If the book is not on-device the function returns the empty string. If a book is on-device it returns at least three key:data items. Two keys are always there: 'name' and 'count' with the obvious values. There will also be at least one of the keys 'main', 'carda', and 'cardb', telling you where the book is stored on the device. You can get more than one storage key if the book is on the device more than once. The value part of of a storage item is the UUID calibre assigned to the storage. Example:
Code:
name:Folder Device, count:3, main:6e3f844e-bcd8-43c9-8a13-5e1dba3ccf1b
which says that there are 3 copies of the book on the "Folder Device", all in "main" memory.

You use the "select" function to get the data you are interested in.

The funny thing: I decided not to commit the changes thinking that no one would use the function. Was I wrong? Would this function get used?
chaley is offline   Reply With Quote