Series template not working send to device
I have the following setup to conditionally add the series and series index to a book's path/filename when sending to a device:
books/{#genre:subitems(1,2)}/{series:||/}{series_index:0>3s|| -}{title} ({authors})
If a book has genre A.B, series C, and series index I, this should save the book file to:
books/B/C/I - title (authors).ext
If there is no series, it should be:
books/B/title (authors).ext
This works fine sending books w/o series info, and it works in the template editor sample results. It will also properly populate a custom column if I create one called series_and_number and give it this template as the value:
{series:||/}{series_index:0>3s|| -}
However, when I actually go to send books that have series info to the device, it names them "G_C-EXCEPTION! Unknown format code '_' for object of type 'str'".ext and dumps them in the root directory of the device. (I presume that's because it builds the path in the same operation as the filename.) This happens regardless of whether or not I directly use the template string above, or the custom column built from the template string, in the "send to device" dialog.
This has been tried on Calibre 7.10 and Calibre 7.12.
What am I doing wrong?
Thanks
Last edited by algernonramone; 06-05-2024 at 01:38 PM.
|