View Single Post
Old 01-24-2023, 02:57 AM   #488
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,082
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question:

Previously, in the template I have to generate Kobo collections (not composite; Action Chains single-field edit) was something like this:

Code:
if $#booktype == 'Fanfiction' then 'Fanfiction' fi,
if $#booktype == 'Fiction' then 'Fiction' fi,
if $#booktype == 'Nonfiction' then 'Nonfiction' fi,
(#booktype is enumerated)

Obviously, that could be simplified:

Code:
program:
	genre = $#subjects;

	colls = strcat(	
		$#booktype,	
		if 'overdrive' in approximate_formats() then 'Loans,' fi,
		if $$#purchasecost == '0.00' then 'Freebies,' fi,
		if '^Horses$' inlist genre then 'Horses,' fi,
		if '^Cozy Mystery$' inlist genre then 'Cozy Mysteries,' fi,
		if '^(Fantasy|Science Fiction|Paranormal)$' inlist genre then 'Fantasy & Sci-Fi,' fi,
		if 'Omnibus' in $#admintags then 'Omnibuses' fi
);

 new_colls = list_union($#kobocoll, colls, ',')
How do I get #booktype to also return a comma?

Last edited by ownedbycats; 01-24-2023 at 03:01 AM.
ownedbycats is offline   Reply With Quote