View Single Post
Old 09-14-2012, 02:41 AM   #17
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The question "how do I find the exact path to a book" has come up several times in the last month. I am wondering whether I should add a template function that returns it.

To be precise, I could add two functions, one that returns the path to the current library and one that returns the path to a given format. I don't see the use in a function that returns the path to the folder containing the formats, but I could be convinced otherwise.

It is worth noting that calibre creates paths in the library that save-to-disk cannot replicate. In particular, paths in the library can contain multiple consecutive spaces. Save to disk (and send to device) will reduce these to one space. Thus even if I add the function it won't be possible to recreate an identical folder hierarchy even with these functions. Also note that it is likely that these functions won't work in save templates. Reason: the template processor will need access to the database to evaluate these functions, and the DB is not available to the send/save jobs.
chaley is offline   Reply With Quote