View Single Post
Old 03-12-2018, 12:03 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,613
Karma: 169712392
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Divingduck View Post
Oh, my fault...

This one should work like you want
Code:
program:
contains(ifempty(field('series'),'-'),'-',template('{authors} - {title}'),template('{authors} {series:|(| }{series_index:0>5.2f|#|)} {title}'));
Remark:
Its working in program mode.
I check for series and give back series or '-' if there is no series.
contains check for '-' and use then one of the two template structures.

Not elegant but works.

Edit: Forgot to mention that you need to copy the complete string (both lines) in your template. You can do this direct or via the template editor
Looking at your code, I suspect that it will write all the books into a single directory instead of the default Author_Sort directories inside the selected Save to directory.

I suspect adding {author_sort}/ to the templates between the ' and the {author} would return to the default saving into author_sort folders.

Code:
program:
contains(ifempty(field('series'),'-'),'-',template('{author_sort}/{authors} - {title}'),template('{author_sort}/{authors} {series:|(| }{series_index:0>5.2f||)} {title}'));
Serial numbers filed off and saved for future reference....

Last edited by DNSB; 03-12-2018 at 12:22 PM. Reason: Added modified code
DNSB is offline   Reply With Quote