Quote:
Originally Posted by Vespero
Is there a way to change the template based on the format of the book being sent?"
I send both .epub and .cbz to my device and prefer different naming schemes for them.
With .epub, I like
books/{author_sort}/{series}/{title}
But with .cbz, I want
books/{author_sort}/{series}/{title}
(being comics, each chapter/volume is already named {series}{series_index})
Currently, I either have to manually edit the template each time I switch formats (which also requires restarting Calibre and remounting the folder), or I have to switch how the device is mounted (Connect to Folder for .cbz and Wireless Connection for .epub)
There's got to be an easier way though, right?
|
The template doesn't know and can't see the format type (extension).
@ownedbycats solution works for books that have one or the other format. If a book has both and you choose the format when you send to device then it won't give you joy. However, if you let calibre choose by priority then you can build that same priority into the template.
I haven't looked at file name template processing for years.
Now that we have template global variables I might be able to pass the format extension there. EDIT: No can do. The file path is generated before the extension is chosen.