06-05-2024, 12:55 PM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Feb 2015
Device: None
|
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 02:38 PM. |
06-05-2024, 12:58 PM | #2 |
Member
Posts: 16
Karma: 10
Join Date: Feb 2015
Device: None
|
Oops - it should say "sending to device" instead of "saving to disk" in the subject. Any way to change that?
|
Advert | |
|
06-05-2024, 01:01 PM | #3 |
Well trained by Cats
Posts: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
06-05-2024, 02:48 PM | #4 | |||
Grand Sorcerer
Posts: 12,032
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Code:
{series_index:0>3.0f|| -} Quote:
If you are editing the template in the device configuration then I don't see a reason it shouldn't work. In that case please supply a sample empty book with metadata that isn't stored properly so I can test it with real data. |
|||
06-05-2024, 03:46 PM | #5 |
Member
Posts: 16
Karma: 10
Join Date: Feb 2015
Device: None
|
It worked! Thanks!
Here is the final version of the template string: books/{#genre:subitems(1,2)||/}{series:||/}{series_index:0>3s|| - }{title} ({authors}) Exactly what I wanted, thanks again! |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Send to Device Template not working | dkperez | Library Management | 3 | 12-01-2016 09:36 PM |
Send to device - Template help | Snow Sciles | Library Management | 12 | 05-26-2014 06:16 PM |
Issue with Send to Device template | BookJunkieLI | Library Management | 5 | 02-14-2014 02:16 AM |
Template Help - Send to device | Snow Sciles | Library Management | 4 | 10-08-2013 08:54 AM |
Send to device template | rockeh | Calibre | 6 | 08-17-2010 06:28 PM |