View Single Post
Old 04-11-2021, 12:14 AM   #1
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,036
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: Matching an entire list

I want one of the clauses of a gpm template to return true iif the only available format is epub. I tested with this:

Code:
program:
	f = $formats;

	if 
		list_contains(f, ',', '^epub$', '1', '') 
	then 'foobar' 
	fi
However, it returns 'foobar' for every book that has epub, even if there's other formats.

What should I do?

EDIT: Also, there are other times I might want to match the entire list contents. I am not sure how to do that though.

Last edited by ownedbycats; 04-11-2021 at 12:32 AM.
ownedbycats is offline   Reply With Quote