View Single Post
Old 06-17-2020, 05:00 AM   #2
Irian
Enthusiast
Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.Irian has a complete set of Star Wars action figures.
 
Posts: 47
Karma: 450
Join Date: Mar 2011
Device: PRS-600, PRS-650, Tolino Vision 3 HD, Kobo Libra H20
Ok, I probably found the reason: The series was pretty old (I added the first books to my calibre probably more than 10 years ago).

When I renamed the series in all books of it, it worked. Then I renamed it back (to the one that produced the error) and suddenly it also works.

My guess is that something has changed in the way Calibre handles/stores series data in the last years and older series have some property or whatever that confuses the save template.

Additionally, just in case someone stumbles upon the templates, I was (rightly so) told that they are pretty messed up and the result is pretty unpredictable, so I switched to template program mode and did this, instead:

Code:
program:

stripped = re(field('series'), '^(A|The|An|Der|Die|Das)\s+', '');
initial = substr( stripped, 0, 1 );
index = template('{series_index:0>2s}');

foldernameforseries = strcat(initial, '-Series/', field('series'), '/', index, ' - ');
defaultfoldername = 'other/';

finalfolder = test(field('series'), foldernameforseries, defaultfoldername);

strcat('books/', finalfolder, field('title'));
Personally, I like general program mode much better than the single function mode, since it's much clearer to me and requires a lot less brackets ;-)

Last edited by Irian; 06-17-2020 at 06:46 AM.
Irian is offline   Reply With Quote