View Single Post
Old 03-12-2018, 07:16 PM   #7
Kaimeirra
Junior Member
Kaimeirra began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
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
PERFECT! Works exactly as I asked
Thanks for the concern about the folders DNSB, I am using folder sorting as well but as I knew how to add that I didnt include it in the coding I was asking help for. So this is what I am using:

program:
contains(ifempty(field('series'),'-'),'-',template('{author_sort}/{authors} - {title}'),template('{author_sort}/{series}/{authors} {series:|(| }#{series_index:0>5.2f||)} {title}'));

Sorry I dont know how to put it in a code: box

Thanks again for everyones help!
Kaimeirra is offline   Reply With Quote