View Single Post
Old 01-08-2024, 04:51 PM   #2835
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,110
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by JSWolf View Post
Would you mind sharing your code for the finished column? I want to do that but no need to reinvent the wheel. Thanks.
As an alternate to DNSB's, here's my custom readstatus() template function:

Code:
program:

	if 'dnf' inlist $#admintags
	then 'didnotfinish'

	elif ($$#percentread >=#1 && $$#percentread <=#99) || ($#readinglist == 'Reference')
	then 'currentlyreading' 

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

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

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

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

	fi
I use it anywhere that I need to reference the read-status of a book. However, one of its main uses is my composite Read Status column:

Code:
program:
	status = readstatus();
	times = $$#timesread;

	switch_if(
		status=='currentlyreading' && times>#0, 'Currently Rereading',
		status=='currentlyreading', 'Currently Reading',
		status=='toberead' && times>#0, 'To Be Reread',
		status=='toberead', 'To Be Read',
		status=='read', 'Read',
		status=='unread' && 'readinggoal:' in $#admintags, 'Backlog',
		status=='unread', 'Unread',
		status=='didnotfinish', 'Did Not Finish',
		''
	)
ownedbycats is offline