I use Action Chains' single-field edit to populate a custom column, #kobopath:
Code:
program:
# Returns 'Fanfiction/Fandom' tag 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 booktype for others
else
$#booktype
fi
Then fit that into the send-to-device path (
see here for why I'm using a re):
Code:
{#kobopath:re(_,/)}/{author_sort:sublist(0,1,&)}/{title} - {authors}
The main thing is that I can't remember how (or if even possible) to make a GPM template output the results of a single-function template. It may be easier to make separate chains for each template-type.