Additionally, I updated my #kobocoll generation template again to resolve a
Kobo glitch (tl;dr: too many books in a collection causes sync to stall):
Code:
program:
genre = $#subjects;
colls = strcat(
## $#booktype, ',',
## if $$#purchasecost == '0.00' then 'Freebies,' fi,
if 'Omnibus' in $#admintags then 'Omnibuses,' fi,
if 'overdrive' in approximate_formats() && !'formerlibrary' in $#admintags then 'Loans,' fi,
if $#booktype=='Fanfiction' then list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction: \1,') fi,
if '^Cozy Mystery$' inlist genre then 'Cozy Mysteries,' fi,
if '^Horses$' inlist genre then 'Horses,' fi,
if '^(Science Fiction)' inlist genre then 'Science Fiction,' fi,
if '^(Fantasy|Paranormal)$' inlist genre then 'Fantasy & Paranormal,' fi,
);
if colls == '' then colls == strcat($#booktype, ',') fi;
new_colls = list_union($#kobocoll, colls, ',')
I'm trying to make it so that
a) Define whatever the strcat returns as 'colls'
b) if strcat returns nothing and 'colls' is empty, define #booktype and a comma as 'colls'
c) Merge colls with the existing column (taglike).
It's not working for me though; I just get a blank result. I also tried !colls with the same result. I thought of enclosing it in a switch_if but wasn't sure what to put as the first test_expression.