Quote:
Originally Posted by ownedbycats
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.