Code:
program:
# Returns 'Fanfiction/Fandom' for fanfics
if $$#fanficcat then
list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')
# Returns 'Kobo' for Kobo store books
elif '\[Kobo Store\]' in $#kobostatus then 'Kobo Store'
# Returns 'PDF' for PDFs
elif $formats == 'PDF' then
'PDF'
# Returns 'Loans' for Loans
elif 'Loans' in $#vls then
'Loans'
# Returns topmost tag for all other books
else
re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1')
fi
For the 'topmost tag', what would be the best way to specifically exclude '[Cleanup]'?