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 10-24-2022, 03:46 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,972
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template tester: "can be used only in the GUI"?

If I go to Add Books > open the settings for a composite column > right-click 'template' to open the editor and put in:

Quote:
program: virtual_libraries()
The template value shows:

Code:
EXCEPTION: The function virtual_libraries can be used only in the GUI
Is this expected? The message is a bit confusing as I thought GUI was "not server or command-line tools."
ownedbycats is online now   Reply With Quote
Old 10-24-2022, 04:25 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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
If I go to Add Books > open the settings for a composite column > right-click 'template' to open the editor and put in:

The template value shows:

Code:
EXCEPTION: The function virtual_libraries can be used only in the GUI
Is this expected? The message is a bit confusing as I thought GUI was "not server or command-line tools."
What exactly are you doing? What do you do to get to "Add books > open the settings for a composite column"?
chaley is offline   Reply With Quote
Old 10-24-2022, 04:27 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,972
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
- Right-click column header
- Open 'Add your own column' (This was a typo )
- Find a composite column
- Double-click to open the dialog
- Right-click the template field and open the editor
- Add the code there
ownedbycats is online now   Reply With Quote
Old 10-24-2022, 04:46 PM   #4
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Sorry, but it doesn't fail for me.

Running current source, I tried:
  1. Starting calibre.
  2. Right-click on title's header (for me the first column).
  3. Choose Add your own columns.
  4. Pick a composite column. I tested both with and without "behaves like tags".
  5. Enter "program: virtual_libraries()" into the template in the template editor.
  6. Press OK
Works fine. No error message.

I then restart calibre. Again, fine, no error message.

What are you doing different from the above?
chaley is offline   Reply With Quote
Old 10-24-2022, 04:52 PM   #5
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,972
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I pulled the latest source (most recent commit: 3c5b4bf) before starting again.

The only difference is that the column I was testing with (taglike) already contained virtual_libraries().

I tried adding it to a different column (not taglike) and it still error'd.

I thought perhaps it was because I'd accidentally de-selected all the books but I tried selecting 3 and still got the same message.
Attached Thumbnails
Click image for larger version

Name:	2022-10-24 17_51_30-Edit template.png
Views:	251
Size:	24.9 KB
ID:	197347  

Last edited by ownedbycats; 10-24-2022 at 04:59 PM.
ownedbycats is online now   Reply With Quote
Old 10-24-2022, 05:20 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Could it have anything to do with this transient glitch?

Click image for larger version

Name:	Vl glitch.jpg
Views:	830
Size:	32.3 KB
ID:	197348

It happens when I start calibre in the Test library or switch to it. As soon I select another book the problem goes away, i.e. VL Vanilla show same content as VL Taglike except its white non-clickable text.

Screenshots of VL Vanilla column and temp VL definitions attached.

@chaley - I can PM you the Test library database if you're interested, I don't regard this as a bug because it's not a real world scenario.

Win 10, Calibre 6.7.1

BR

PS : I did a database restore - glitch persists
Attached Thumbnails
Click image for larger version

Name:	temp VL.jpg
Views:	64
Size:	93.8 KB
ID:	197349   Click image for larger version

Name:	VL Vanilla.jpg
Views:	70
Size:	51.5 KB
ID:	197350  

Last edited by BetterRed; 10-24-2022 at 05:30 PM. Reason: PS added
BetterRed is offline   Reply With Quote
Old 10-24-2022, 05:37 PM   #7
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
Could it have anything to do with this transient glitch?

Attachment 197348
This can happen if a naked search references a composite column that references virtual_libraries(). What is a naked search? A search for data without a column key or for a column key that doesn't exist, so all columns are searched. You can limit what columns are used for naked searches in Preferences / Searches. If a naked search requires evaluating "virtual_libraries()" as well as a composite column with a template invoking "virtual libraries()" then we have a recursive search.

Yes, this is technical but I don't know how to better describe detecting directed cyclical graphs.
chaley is offline   Reply With Quote
Old 10-24-2022, 06:06 PM   #8
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,972
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I occasionally get the recursion glitch too, mostly on Read|Unread when starting up -- I'm not sure if there's something wrong with those or whether they're just the first evaluated.

Here's the searches I use for my VLs -- I don't think there's any missing column keys and nothing references virtual_libraries() - I think the only composite referenced is #onkobo, which returns yes/no based on the value of an enumerated column.


Note: readstatus() is a custom template that returns values based on two columns (#percentread and #readinglist).

Currently Reading: template:"program:readstatus()#@#:t:~(currentlyrea ding|toberead)"

Read: template:"program:readstatus()#@#:t:=read"

Unread: template:"program:readstatus()#@#:t:=unread"

Fiction: #booktype:"=Fiction"

Fanfiction: #booktype:"=Fanfiction"

Nonfiction: #booktype:"=Nonfiction"

Comics: #booktype:"=Comics"

Documentation & Manuals: #booktype:"=Documentations & Manuals"

Magazines & Periodicals: #booktype:"=Magazines & Periodicals"

Series: series:true AND NOT #booktype:"~(fanfiction|documentation|magazines)"

Loans: search:"=Is library book"
(saved search: (formats:#=1) AND (formats:overdrive))

eBooks: search:"=Has eBook" AND NOT #booktype:"~(fanfiction|documentation)"
(saved search: NOT formats:"~(overdrive|paperbook)"
OR NOT formats:#=1
)

Physical Books: formats:paperbook

On Device: search:"=On Device"
(saved search: ondevice:true OR #onkobo:true)

Cleanup:tags:"=[Cleanup]"

Last edited by ownedbycats; 10-24-2022 at 06:25 PM. Reason: had to disable smilies...
ownedbycats is online now   Reply With Quote
Old 10-24-2022, 07:30 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
...

Yes, this is technical but I don't know how to better describe detecting directed cyclical graphs.


Or; don't be lazy by searching for lancet, search for tags:"lancet" instead

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template: saving template tester when restarting Calibre ownedbycats Library Management 14 03-29-2021 05:57 PM
"Normal" template inside GPM template ownedbycats Library Management 20 12-02-2020 09:40 PM
"Add a book" template like "Save to disk"? vr8ce Library Management 10 06-09-2017 08:16 AM
Two suggestions for Template Tester PeterT Calibre 3 09-08-2014 06:04 AM
Kindle DX optimal "page" size - PDF or Word template guiyoforward Amazon Kindle 12 09-28-2010 07:05 PM


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


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