View Single Post
Old 03-15-2021, 05:35 PM   #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,112
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: unexpected result with gpm

I was modifying one of my templates and although it's valid I got a result I did not expect.

Code:
program:
k = field('#kobocoll');
if check_yes_no('#onkobo', 0, 1, 0) then 'sync.png' 
	else if check_yes_no('#onkobo', 0, 0, 1) then
		if list_contains(k, ',', '^Kobo Store$', '1', '') then 'drm-locked.png' fi;
		if list_contains(k, ',', '^Send to Device$', '1', '') then 'sync.png'			
	else 'reader.png'
        fi
    fi
fi
For a book with #onkobo:yes and #kobocoll:"=Kobo Store" I expected to get drm-locked.png.

Instead I got reader.png

I put it in template tester and got the same result so it's not something else accidentally overriding the icon.

I tried removing the ^ and $ in case it was a matching issue but that did not fix it.

What mistake did I make?

Last edited by ownedbycats; 03-15-2021 at 05:40 PM.
ownedbycats is offline   Reply With Quote