View Single Post
Old 07-17-2021, 05:31 PM   #142
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,109
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question:

I have this template in an Action Chains single-field edit for semi-automated updating of my Kobo collection/shelf column:

Code:
program:
	g = field('#genres');
	k = field('#kobocoll');
	vl = field('#vls');

	v = first_non_empty(
		list_contains(vl, ',', '^Loans$', 'Loans', ''),
		list_contains(g, ',', '^Fanfiction$', 'Fanfiction', ''),
		list_contains(g, ',', '^Horses$', 'Horses', ''),
		list_contains(g, ',', '^Cozy Mystery$', 'Cozy Mysteries', ''),
		list_contains(g, ',', '^(Fantasy|Science Fiction)$', 'Fantasy & Sci-Fi', ''),
	);

	list_union(k, v, ',')
Performance isn't an issue, it's only run on demand. But since the "Loans" virtual library only criteria is that the book has an .OVERDRIVE format, would it be better practice to check for that rather than the VL?
ownedbycats is offline   Reply With Quote