View Single Post
Old 03-16-2022, 08:30 AM   #930
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: 8,666
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I use this as a stored template, readstatus().

Note that #percentread is integer and #readinglist is series-like managed with the Reading List plugin.

Code:
program:

	if $$#percentread >=#1 && $$#percentread <=#99
	then 'currentlyreading' 

	elif "To Be Read" in $#readinglist && $$#percentread ==#0
	then 'toberead' 

	elif $$#percentread >=#100
	then 'read' 

	elif $$#percentread == 'None'
	then 'undefined' 

	elif $$#percentread >=#0
	then 'unread' 

	fi
This allows the user to use readstatus() == 'currentlyreading' or '(unread|toberead)' in readstatus() in templates rather than checking the columns directly.

It would probably also work as a composite column.

Last edited by ownedbycats; 03-16-2022 at 10:18 AM.
ownedbycats is online now   Reply With Quote