View Single Post
Old 02-06-2023, 04:33 PM   #501
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,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Also, another question related to column icons. In an advanced rule, what is the most correct way to return no icon?

Example: My 'Cleanup' VL also searches for marked:true books.

Code:
program:

first_non_empty(
 [lots of entries for specific metadata issues]

## Fallback
	if is_marked() then ' ' fi,
	if 'Cleanup' inlist virtual_libraries() then 'polish.png' fi
)
If I use '' (no space), it returns 'polish.png' for marked books. Hence the whitespace.
The function first_non_empty() stops when it finds a non-empty value. The string '' is empty so the function goes on to the next possibility.

The fix is to remove the is_marked() check and add something like
Code:
! is_marked() &&
to the cleanup check
chaley is offline   Reply With Quote