View Single Post
Old 02-23-2023, 05:37 PM   #518
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,110
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
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.

Last edited by ownedbycats; 02-23-2023 at 06:39 PM.
ownedbycats is offline   Reply With Quote