View Single Post
Old 04-30-2021, 04:46 AM   #90
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,461
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
What would be the best way to turn my "Missing Kobo Collection" saved search into a icon for column templates?

Code:
#onkobo:true 
AND (
	#fanficcat:true 
	OR #genres:"=Fantasy" 
	OR #genres:"=Science Fiction" 
	OR #genres:"=Cozy Mystery" 
)

AND (
	#kobocoll:false 
	OR (#kobocoll:"=[Send to Device]" AND #kobocoll:#=1)
	OR (#kobocoll:"=[Kobo Store]" AND #kobocoll:#=1)
)
(btw, thanks for implementing multi-line saved searches. It's helpful )
Do you want to make the above into an if condition? If so then something like this:
Code:
program:
	if (
		$#onkobo
		&& 
		(
			$#fanficcat
			|| '^Fantasy$' inlist $#genres
			|| '^Science Fiction$' inlist $#genres
			|| '^Cozy Mystery$' inlist $#genres 
		) 
		&&
		(
			$#kobocoll == ''
			|| ( 	'^\[Send to Device\]$' inlist $#kobocoll 
					&& list_count($#kobocoll, ',') ==# 1)
			|| (	'\[Kobo Store\]$' inlist $#kobocoll 
					&& list_count($#kobocoll, ',') ==# 1)
		)
	) then
		'foo'
	fi
I made no attempt to optimize the tests. For example, the duplicated list_count can certainly be factored out.
chaley is offline   Reply With Quote