![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Mar 2017
Device: kindle
|
Column to show mags. that are NOT in any virtual Libraries
Hi,
I have a large collection of magazines. I created several virtual libraries with search expressions to classify them. I would like to create a custom column to show all the magazines that have NOT been included in any virtual libraries.This way I can add the search expressions to the appropriate virtual library. Anybody know how to do that? Please bear in mind that I am a beginner at Calibre. Thanks! |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 149999
Join Date: Aug 2008
Location: Ireland
Device: Kobo Glo, Kobo Touch, Kindle PW3
|
This might help;
https://www.mobileread.com/forums/sh...d.php?t=282127 |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Mar 2017
Device: kindle
|
Thanks! I'll try that...
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Mar 2017
Device: kindle
|
Ok I tried the instructions given in the above link and , like Thinkblot, I had the same error "maximum recursion depth exceeded..."
Then like him I also tried creating the column , but this time as"column built from other columns" (without the "behaves like tags" part) Now I get this error: "This function can be used only in the GUI". Interestingly, in both times, the first magazine show up correctly and the column displays teh name of the virtual library that it's in. All the following magazines give the same error. Question : I used the lookup name: virtlibs. Is this correct? can I try something else? |
![]() |
![]() |
![]() |
#5 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I created a 'Has Location' VL based on presence of value in a long text column - #location/Location. If I F2 in the Location column and do nothing (including leaving it empty) the error goes away for that book. I switched to another library and back to my test library and no errors Try that, or stop/start calibre. BR |
|
![]() |
![]() |
![]() |
#6 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Mar 2017
Device: kindle
|
Hi ,
Thanks for your help, it looks like you have a solution. However , being a complete beginner at this I will need more of your help. Could you describe your steps in more detail? I think I understand that you created a virtual library and called it "Has Location" . Did you then use #location/Location as the search term? If I do that I get a warning that there are no results in that column... sorry but I need more info on how you did that. thanks! |
![]() |
![]() |
![]() |
#7 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Alaa - No problems, I'll use screen shots so we get the ducks lined up right on the pond.
This is my Location column definition This is my Virtual Libraries column definition This is my Has Location virtual library definition This is my list of columns that get shown in the book list And this is the result - after a library switch or stop start to get rid of the error messages. Those spurious error messages should be reported as a bug at Bugs : calibre. Would be better if you did that, because you have it on a real library, whereas mine is on my kitchen sink test library. Include a link to this threat in the post. BR |
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Alaa - don't worry about reporting the 'bug', I took it up with chaley in this thread ==>> Problem with template functions and library maintenance
@chaley - I did some tests on an fresh empty library and I could not reproduce the TEMPLATE ERROR... I saw previously. Happy to write that down to me not doing a restart when I should have done, or using a much abused library ![]() But I did find an anomaly that could be related. Here is a blow-by-blow script of what I did (twice - i.e. it's repeatable) Code:
create two custom columns - #first_location/First Location, Long text . . . header on the side, HTML #second_location/Second Location, Long text . . . header on the side, HTML Apply and Restart create two virtual libraries Has First Loc, #first_location:true Has Second Loc, #second_location:true create two custom columns (to test if tags-like was relevant - it seems not) #virtlibs_like_tags/Virtual Lib Like Tags, column built from other columns, behaves like Tags, Sort/search column by Text, Show in tags browser: unchecked, Show as HTML in book details unchecked #virtlibs_not_tags/Virtual Lib Not Tags, column built from other columns, Sort/search column by Text, Show in tags browser: unchecked, Show as HTML in book details unchecked Apply and Restart Added a Third Location, same as First and Second, Put some HTML values into Third Location. Added another VL - Has Third Loc, books with a Third Location appeared in the VL. However the Virtual Libs columns didn't update to show the Has Third Loc VL . . . until I did a restart But once I'd done a restart. the Virt Lib columns updated dynamically. Looks to me if as the template {:'virtual_libraries()'} is only evaluated (goes looking for VLs) when a library is opened. Ideally I guess it should refresh if a VL is added, edited, or removed, or less ideally any VL add/edit/remove should ask for a restart a'la custom columns... Hope this makes sense BR Last edited by BetterRed; 03-12-2017 at 05:33 AM. |
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Mar 2017
Device: kindle
|
Hi thanks for your amazing help and patience with the step by step instructions and screenshots.
I did exactly as you describe but sadly I 'm still getting teh same result - see image 1. |
![]() |
![]() |
![]() |
#10 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Alaa - does it fix itself if you do a restart (Ctrl+R)?
Clearly, there is something not quite right here, but chaley, the template and virtual library aficionado, is now aware of it. So hopefully between your posts and mine he will have enough information to figure out what's happening and fix it ![]() ![]() BR |
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I might be able to figure out what is happening if you send me a (zipped) copy of your metadata.db file. If you are willing then send it to calibre_bugs [AT] charles [DOT] haleys [DOT] org (make the obvious substitutions). Don't send any books. The metadata.db file is in the top-level calibre library folder. |
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@BR: I have duplicated not having the VL column updating. I am not sure I can fix it with acceptable performance. The problem is that changes to VL structure do not invalidate any data for the books, meaning that the info shown by the VL column is not repainted. The not-invalidated behavior is reasonable given that VLs are in fact not book data. I would need to somehow force a global repaint whenever the VL structure changes, which would be *very* slow.
Restarting calibre forces the recomputation, as does changing any data in the book. Selecting a book, choosing Edit Metadata, then pressing OK without making any changes refreshes the column. So does selecting multiple books (e.g., all of them), choosing edit metadata multiple, making no changes, then pressing OK. It is worth noting that the virtual_libraries() formatter function can be *exceedingly* slow if there are a lot of VLs. How many a "lot" is depends on memory and book count. The problem is that if there are a "lot" then some will fall out of calibre's VL cache. If this happens then the VLs must be recomputed from scratch for each book. Sad. For amusement, for some time I have been working on a "library closed" plugin that will update a tags-like column with all the virtual libraries "containing" a book. This is *much* higher performance because the computations are done once, can be optimized, and doesn't use the cache. Of course, the downside is that the answer (the content of the updated column) is wrong until the library is closed and opened again if the VL structure changes or if metadata affecting VLs changes. |
![]() |
![]() |
![]() |
#13 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,733
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@chaley - that confirms my deductions. Speaking for myself only, I can easily live with workarounds like 'do a restart'. For the benefit of others, the VL list for an individual book can also be refreshed via F2 (metadata edit) in any editable column
![]() I only have half a dozen VL's in my biggest library, the other libraries no more than four. I don't actually use a Virtual Libraries column, I was only verifying Alaa's result. But no matter what I do, I cannot replicate any errors on the fresh library I created yesterday. This morning I tried removing one of the 3 virtual libraries columns, and adding it back with same names etc - no ill effects. Would it help if I sent you my kitchen sink test library, where I did get the error? BR |
![]() |
![]() |
![]() |
Tags |
column, custom, library, virtual |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Column to display Virtual Libraries | thinkblot | Library Management | 2 | 12-28-2016 02:09 PM |
IF statement in virtual libraries | sbin | Library Management | 5 | 11-01-2016 05:34 AM |
Virtual Libraries | scottmc | Library Management | 0 | 08-13-2014 07:15 PM |
Virtual Libraries | Ortep | Library Management | 68 | 12-21-2013 04:23 AM |
Virtual Libraries - web? | soundsfromsound | Calibre | 20 | 08-16-2013 02:15 PM |