That worked.
Tweaking my #kobopath template:
Code:
program:
if $#kobostatus then
# Returns 'Fanfiction/Fandom' tag for fanfics
if $$#booktype == 'Fanfiction' then
list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')
# Returns 'PDF' for PDFs
elif $formats == 'PDF' then
'PDF'
# Returns 'Loans' for Loans
elif 'OVERDRIVE' in $formats then
'Loans'
# Returns booktype for others
else
$#booktype
fi
fi
As seen in this screenshot, something that has multiple Fanfiction.Whatever tags lists all
three. Oops!
Due to my tagging practices:
a) Fanfiction.Crossover is the always the first in the list;
a) I only have multiple tags when one is 'Fanfiction.Crossover'
b) I always prefer 'Crossover' for the first pick.
So based on this, I thought of two separate solutions:
Option #1: splitting the list:
Code:
if $$#booktype == 'Fanfiction' then
list_split(list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1'), ',', 'ff');
ff_0
Disadvantage: This relies on Fanfiction.Crossover being first on the list. However, I rarely make changes to those subtags.
Option #2 A second check for 'Crossover' specifically. Here, I'm checking the taglike #fanficcat but I could also check Fanfiction.Crossover directly.
Code:
if $$#booktype == 'Fanfiction' then
if 'Crossover' in $#fanficcat then 'Fanfiction/Crossover'
else list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')
fi
Disavantage: This relies on 'Crossover' always being in #fanficcat (or Fanfiction.Crossover in tags). This is pretty much always the case.
Another disavantage: This also relies on 'Crossover'
not being in #fanficcat (or Fanfiction.Crossover in tags) when unneeded. Thanks to the way FFF works with multi-fandom stories, this
has happened.
Based on that second disadvantage, I'm inclined to go with option #1. Does this make sense?