05-30-2024, 02:58 AM | #1351 |
Grand Sorcerer
Posts: 6,366
Karma: 12117217
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
|
05-30-2024, 05:33 AM | #1352 |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
|
Advert | |
|
05-30-2024, 05:34 AM | #1353 | |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
05-30-2024, 02:21 PM | #1354 |
Custom User Title
Posts: 9,367
Karma: 64435965
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I tested with the official version, then with the test version after you asked me to.
|
05-30-2024, 03:49 PM | #1355 |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
OK, since I cannot replicate this, nor figure out the reason for it, we have one of two options:
It is your call. |
Advert | |
|
05-30-2024, 08:33 PM | #1356 |
Custom User Title
Posts: 9,367
Karma: 64435965
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I pm'd you a link. I'm inclined to think it might be just something about the size of my database that's doing it, especially since I wasn't able to replicate on an empty library with the same structure.
|
05-30-2024, 08:44 PM | #1357 | |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
Will check tomorrow if I can spare some time. |
|
05-31-2024, 06:19 AM | #1358 |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
OK, I've tested with your library, and here what happened:
I will post a test version shortly. |
05-31-2024, 06:31 AM | #1359 |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Here is a new test version
Last edited by capink; 06-10-2024 at 08:20 AM. Reason: remove attatchment |
05-31-2024, 02:05 PM | #1360 |
Custom User Title
Posts: 9,367
Karma: 64435965
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Yes, that fixes it! What a strange issue.
Out of curiosity, what was the cause of the crashing issue? Last edited by ownedbycats; 05-31-2024 at 04:46 PM. |
06-01-2024, 08:05 AM | #1361 |
Grand Sorcerer
Posts: 11,962
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@capink: I think the slowdown is caused by commit "Template searches should never be cached.". This changes would cause a template search to be re-executed wherever it occurs in the list of saved searches. Before, the cached result would be used even if it was wrong. On the other hand, it would take millions of template searches for this change to cause the delays you are seeing. It is hard to believe that the saved search tree would cause this, but I suppose it is possible if there are thousands of saved searches and all of them run some template search(es) multiple times.
As for running the search on a single book, this should work, although I didn't test it in the actual plugin: Code:
def is_search_valid(db, search_text): # search in a vl of only one book for performance res = True try: book_ids = set((db.all_ids()[0],)) except: book_ids = None try: db.new_api.search(search_text, book_ids=book_ids) except ParseException: res = False return res I don't see any reason why the old code wouldn't limit the query to the single book. The restriction was evaluated before the search, returning a set of candidates (1 book). The saved search query should be run on that one book. Of course, as noted above the "id=N" query is run on every book. |
06-01-2024, 01:30 PM | #1362 |
Custom User Title
Posts: 9,367
Karma: 64435965
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
@chaley - here's the saved_searches from the preferences table. I mentioned that the glitch didn't occur on an empty library copying structure (including the searches).
Code:
"{ ""Books Purchased"": ""#purchasesource:true\nAND NOT #cost:\""=$0.00\"""", ""Books Purchased.Freebies"": ""#purchasesource:true\nAND #cost:\""=$0.00\"""", ""Books Purchased.Purchased 2013"": ""#purchasesource:true \nAND date:=2013"", ""Books Purchased.Purchased 2014"": ""#purchasesource:true \nAND date:=2014"", ""Books Purchased.Purchased 2015"": ""#purchasesource:true \nAND date:=2015"", ""Books Purchased.Purchased 2016"": ""#purchasesource:true \nAND date:=2016"", ""Books Purchased.Purchased 2017"": ""#purchasesource:true \nAND date:=2017"", ""Books Purchased.Purchased 2018"": ""#purchasesource:true \nAND date:=2018"", ""Books Purchased.Purchased 2019"": ""#purchasesource:true \nAND date:=2019"", ""Books Purchased.Purchased 2020"": ""#purchasesource:true \nAND date:=2020"", ""Books Purchased.Purchased 2021"": ""#purchasesource:true \nAND date:=2021"", ""Books Purchased.Purchased 2022"": ""#purchasesource:true \nAND date:=2022"", ""Books Purchased.Purchased 2023"": ""#purchasesource:true \nAND date:=2023"", ""Books Purchased.Purchased 2024"": ""#purchasesource:true \nAND date:=2024"", ""Books Read.Read Multiple Times"": ""#timesread:>1"", ""Books Read.Read in 2020"": ""#datesread:\""^2020\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Books Read.Read in 2021"": ""#datesread:\""^2021\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Books Read.Read in 2022"": ""#datesread:\""^2022\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Books Read.Read in 2023"": ""#datesread:\""^2023\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Books Read.Read in 2024"": ""#datesread:\""^2024\""\nAND #readstatus:\""=Read\""\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Books Read.Reading Goal Multiple Years"": ""template:\""\""\""program: \n\nlist = list_re($#admintags, ',', 'readinggoal:', '');\n\nlist_count(list, ',')#@#:n:>1\""\""\"""", ""Books Read.Recently Finished Reading"": ""#readstatus:\""=Read\""\nAND (#lastread:>14daysago)\nAND NOT #fanficstatus:\""~(In-Progress|Dormant)\"""", ""Cleanup"": ""tags:\""=[Cleanup]\""\nOR search:\""=Cleanup.Missing Identifiers\"" \nOR search:\""=Cleanup.Missing Metadata\"" \nOR search:\""=Cleanup.Other Issues\"""", ""Cleanup.Missing Identifiers"": ""search:\""=Cleanup.Missing Identifiers.Missing amazon: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing ao3: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing ffnet: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing kobo: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing odid: identifier\""\nOR search:\""=Cleanup.Missing Identifiers.Missing standard: identifier\"""", ""Cleanup.Missing Identifiers.Missing amazon: identifier"": ""#purchasesource:\""=Amazon\"" \nAND NOT identifiers:\""=amazon:\"""", ""Cleanup.Missing Identifiers.Missing ao3: identifier"": ""identifiers:\""=url:\""\nAND NOT #fanficstatus:\""=Anthology\""\nAND publisher:\""=Archive of Our Own\"" \nAND NOT identifiers:\""=ao3:\"""", ""Cleanup.Missing Identifiers.Missing ffnet: identifier"": ""identifiers:\""=url:\""\nAND NOT #fanficstatus:\""=Anthology\""\nAND publisher:\""=FanFiction.net\"" \nAND NOT identifiers:\""=ffnet:\"""", ""Cleanup.Missing Identifiers.Missing kobo: identifier"": ""#purchasesource:\""=Kobo\"" \nAND NOT (#admintags:\""=removedfromsite:kobo\"" OR identifiers:\""=kobo:\"")"", ""Cleanup.Missing Identifiers.Missing odid: identifier"": ""formats:\""=OVERDRIVE\"" \nAND NOT identifiers:\""=odid:\"""", ""Cleanup.Missing Identifiers.Missing standard: identifier"": ""publisher:\""=Standard Ebooks\"" \nAND NOT identifiers:\""=standard:\"""", ""Cleanup.Missing Metadata"": ""search:\""=Cleanup.Missing Metadata.Missing booktype\""\nOR search:\""=Cleanup.Missing Metadata.Missing counts\""\nOR search:\""=Cleanup.Missing Metadata.Missing languages\""\nOR search:\""=Cleanup.Missing Metadata.Missing purchase cost\""\nOR search:\""=Cleanup.Missing Metadata.Missing fanfic metadata\"""", ""Cleanup.Missing Metadata.Missing booktype"": ""#booktype:false"", ""Cleanup.Missing Metadata.Missing counts"": ""#pagecount:false\nOR (#chaptercount:false AND NOT formats:paperbook)\nOR (#wordcount:false AND formats:~epub|azw3|mobi)"", ""Cleanup.Missing Metadata.Missing fanfic metadata"": ""#booktype:\""=Fanfiction\"" AND \n(#fanficrating:false)"", ""Cleanup.Missing Metadata.Missing languages"": ""languages:false"", ""Cleanup.Missing Metadata.Missing purchase cost"": ""#purchasesource:true \nAND #purchasecost:false"", ""Cleanup.Missing Metadata.No author link"": ""template:\""\""\""program: link =author_links('|',','); if link then 'true' else 'false' fi#@#:t:false\""\""\"""", ""Cleanup.Other Issues"": ""search:\""=Cleanup.Other Issues.Missing format\""\nOR search:\""=Cleanup.Other Issues.Dormant Fanfics\""\nOR search:\""=Cleanup.Other Issues.Errored Fanfics\""\nOR search:\""=Cleanup.Other Issues.Unwanted crossovers\""\nOR search:\""=Cleanup.Other Issues.Unwanted identifiers\"""", ""Cleanup.Other Issues.Dormant fanfics"": ""#fanficstatus:\""=In-Progress\"" \nAND #fanficupdated:<=365daysago"", ""Cleanup.Other Issues.Errored fanfics"": ""(#fanficerror:true \nAND #fanficstatus:~In-Progress|Dormant)\nOR\n(#fanficerror:\""Story does not exist\""\nAND NOT #fanficerror:\""=Story on Reject URLs list.\""\nAND NOT #admintags:\""removedfromsite:\"")"", ""Cleanup.Other Issues.Missing format"": ""formats:false"", ""Cleanup.Other Issues.Unwanted crossovers"": ""#fanficcat:#=3\nAND\n((#fanficcat:\""=Crossover\"" and #fanficcat:\""=Mass Effect Trilogy\"" and #fanficcat:\""=Mass Effect: Andromeda\"")\nOR (#fanficcat:\""=Crossover\"" and #fanficcat:\""=Half-Life\"" and #fanficcat:\""=Portal\""))"", ""Cleanup.Other Issues.Unwanted identifiers"": ""identifiers:\""=mobi-asin:\""\nOR (identifiers:\""=barnesnobke:\"" AND NOT #purchasesource:\""=Barnes & Noble\"" )\nOR (identifiers:\""=kobo:\"" AND NOT #purchasesource:\""=Kobo\"" )\nOR ((#fanficstatus:\""=Completed\"" OR #fanficstatus:\""=Oneshot\"") AND identifiers:\""=url:\"" AND (identifiers:\""=ao3:\"" OR identifiers:\""=ffnet:\""))"", ""Cleanup.Other Issues.Wrong ISBN type"": ""identifiers:\""=isbn:\"" AND not identifiers:isbn:~^.{13}$"", ""Documentation & Manuals"": ""#booktype:\""=Documentations & Manuals\"""", ""Fanfiction"": ""#booktype:\""=Fanfiction\"""", ""Fanfiction.Has unread chapters"": ""template:\""program: if fanfic_unreadchaps() >=#1 then 'True' fi#@#:t:True\"" \nAND NOT #readstatus:\""=Did Not Finish\"""", ""Fanfiction.Incomplete Fics"": ""#fanficstatus:\""~(Abandoned|Dormant|In-Progress)\"""", ""Fanfiction.Recently Updated"": ""#fanficupdated:>14daysago \nAND NOT #fanficstatus:\""=Oneshot\"""", ""Fanfiction.Waiting for update"": ""template:\""program: fanfic_unreadchaps()#@#:n:0\""\nAND NOT #readstatus:\""=Did Not Finish\"""", ""Has annotations"": ""template:\""program: \n\tannotation_count()#@#:n:>=1\"""", ""Has eBook"": ""NOT formats:\""~(overdrive|paperbook)\""\nOR NOT formats:#=1"", ""Has extra files"": ""template:\""\""\""program: has_extra_files()#@#:b:yes\""\""\"""", ""Has physical book"": ""formats:paperbook"", ""Has series"": ""series:true"", ""Has series notes"": ""template:\""\""\""program: get_note('series', $series, '')#@#:b:yes\""\""\"""", ""Is library book"": ""formats:#=1 AND formats:overdrive"", ""Is physical book"": ""formats:#=1 AND formats:paperbook"", ""On Device"": ""ondevice:true OR #kobostatus:true"", ""Partially read series"": ""template:\""\""\""python:\ndef evaluate(book, context):\n\tdb = context.db.new_api\n\tanswer = context.globals.get('answer', None)\n\tif answer is None:\n\t\tanswer = set()\n\t\tall_series = db.all_field_names('series')\n\t\tfor series in all_series:\n\t\t\tseries_id = db.get_item_id('series', series)\n\t\t\tbooks_in_series = db.books_for_field('series', series_id)\n\t\t\tvals = db.all_field_for('#readstatus', books_in_series)\n\t\t\tunique_vals = {v for v in vals.values()}\n\t\t\tif len(unique_vals) > 1:\n\t\t\t\tanswer.add(series)\n\t\tcontext.globals['answer'] = answer\n\treturn 'Yes' if book.series in answer else ''#@#:t:Yes\""\""\"""", ""Recently Added"": ""date:>14daysago"", ""Recently Modified"": ""#lastmodified:>14daysago"", ""Recently Read"": ""#lastread:>14daysago"" }" Code:
program: input = $#kobobookmark; if $#booktype == 'Fanfiction' && substr(input, 0, 10) == 'OEBPS/file' && !$#fanficstatus in 'Anthology,Oneshot' then currentchap = re(input, '.*\/file(\d+).*', '\1') - 1; totalchap = $#chaptercount; totalchap - currentchap fi Last edited by ownedbycats; 06-01-2024 at 01:38 PM. |
06-01-2024, 02:56 PM | #1363 |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
|
06-01-2024, 02:57 PM | #1364 | |
Wizard
Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
06-06-2024, 06:57 AM | #1365 |
Enthusiast
Posts: 29
Karma: 10
Join Date: Jul 2023
Device: KindleOasis10thGen
|
Issue with Action Chains running Editor Chains
Hello,
since recently I'm getting the following error when running Chains from the main Calibre window, which call Editor change which include other Editor chains (worked fine before). Any idea what's wrong please ? I've tried editing the chains and removing actions one by one but it doesn't help... Spoiler:
Last edited by theducks; 06-06-2024 at 10:19 AM. Reason: spoilered log |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 94 | 07-03-2024 07:26 PM |
Action Chains Resources | capink | Plugins | 65 | 07-01-2024 03:12 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |