Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2022, 04:48 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: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
How to recalc a virtual_libraries() column?

I run into an rare glitch where my virtual_libraries() template starts reporting 'recursion detected' when there actually isn't any -- I can't reliably replicate it yet, but I noticed it sometimes happens after I run an action chain that modifies several columns in sequence (maybe the template processor is confused by the values rapidly changing?)

Restarting Calibre fixes the issue, but is there another way to re-calculate the column?

Last edited by ownedbycats; 04-02-2022 at 05:02 PM.
ownedbycats is offline   Reply With Quote
Old 04-02-2022, 05:34 PM   #2
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,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Restarting Calibre fixes the issue, but is there another way to re-calculate the column?
Try selecting all the books then doing Edit Metadata and pressing OK. IIRC this will clear caches but not change any data.

NB: IIRC "Recursion detected" can happen if a saved search references a VL that references a saved search, either directly or through a composite column. The problem is that the second search cannot depend on the results of the first because it hasn't finished yet. I know how to fix it, build a Directed Acyclical Graph (DAG) of the operations, but this is both hard and slow to compute.
chaley is offline   Reply With Quote
Advert
Old 04-02-2022, 06:19 PM   #3
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: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks.

Is there any obvious recursion going on here?

Virtual library:

Code:
search:"=Books Currently Reading" OR #readinglist:"~To Be Read"
Saved search "Books Currently Reading":

Code:
template:"program: readstatus()#@#:t:currentlyreading"
readstatus():

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
#readinglist is a series-like and #percentread is integer.



I'll try changing the VL to query readstatus() directly and skip the saved search:

Code:
template:"program: if '(currentlyreading|toberead)' in readstatus() then 'yes' fi#@#:t:yes"

Last edited by ownedbycats; 04-02-2022 at 06:44 PM.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function virtual_libraries() Divingduck Library Management 12 08-06-2017 11:28 AM
Move selected data from series column to a new custom column fvdham Library Management 3 06-02-2017 03:49 PM
Single column ePUB becomes 2 column when converted to Kindle (mobi) rmcape Conversion 0 09-21-2013 12:52 PM
Using "Build column from other column" custom-column type HFC3 Library Management 3 07-07-2013 03:11 AM
Q: multi-column PDF to single column mobi format converstion auburn1975 Calibre 7 01-28-2012 06:11 PM


All times are GMT -4. The time now is 05:06 PM.


MobileRead.com is a privately owned, operated and funded community.