I'm having some trouble with if statements in the template editor for Saving books to disk.
What I want is to handle three different cases:
If the custom column "Admin tags" (admin_tags) contains "#MAS" then
Code:
#MAS/{series}/{series_index:0>2s| - |}{title} ({authors})
Else, if the Series is not blank:
Code:
{author_sort[0]}/{authors}/{series}/{series_index:0>2s| - |}{title}
Else:
Code:
{author_sort[0]}/{authors}/{title}/{title}
This will hopefully give me:
[export folder]/#MAS/Doctor Who New Adventures/04 - Timewyrm Revalation (Paul Cornell).epub
[export folder]/C/Paul Cornell/The Severed Streets/01 - London Falling.epub
[export folder]/C/Paul Cornell/Chalk/Chalk.epub
(ideally the output would be as listed above, so the /C/ is from the author sort and the other outputs are from the non-sort fields, but I don't really care, if everything comes out with sort order, so it's /C/Cornell, Paul/Severed Streets, The/.... I'm also happy.)
I'm trying to setup a single export job that can be picked up by another program, that needs a folder by series (or, if a book is not part of a series, a folder per book). But it has a lot of trouble with multi-author series that end up in different author folders, so I will tag those manually, so they end up in the "#MAS" folder.
Looking at examples above, they seem to be written as programs. Can I put if statements in the simple template format, or I need to re-write it as a program?
Thanks in advance to anyone who can advise!