If a file has a {edition-(whatever)} section then copy it, otherwise add such a section if there are relevant {tags}
Posted: 19 Dec 2022, 06:03
I'm trying to get this logic working:
1. If a file has a {edition-(whatever)} section, copy it.
2. Else, add such a section if there are relevant {tags}.
3. Do nothing.
So far, I've tried
This works for the first part, but doesn't add the tags section if edition section doesn't exist.
I've tried separating them out like this:
This does work the way I want if the file doesn't have the edition section, but if it does and it's a tag thats also in {tags} the section gets duplicated.
To explain further, this is so I can add custom editions that's not in {tags} and not have FileBot delete them.
1. If a file has a {edition-(whatever)} section, copy it.
2. Else, add such a section if there are relevant {tags}.
3. Do nothing.
So far, I've tried
Code: Select all
{fn.match(/ \{edition-.*\}/) ? fn.match(/ \{edition-.*\}/) : " {edition-${tags[0]}}"}
I've tried separating them out like this:
Code: Select all
{fn.match(/ \{edition-.*\}/) ? fn.match(/ \{edition-.*\}/)}
" {edition-${tags[0]}}"}
To explain further, this is so I can add custom editions that's not in {tags} and not have FileBot delete them.