View Single Post
Old 03-06-2024, 08:48 PM   #23
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,649
Karma: 7908443
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by ownedbycats View Post
Can anyone else replicate this bug?

This saved search indefinitely freezes Calibre when running from source (eventually I kill process), but not on stable:

Code:
template:"""program: has_extra_files()#@#:b:yes"""
Yes I see a hiccup, I too have this saved search. Although in my case this was not an indefinite freeze, it took like 10 seconds to show the only 6 titles in my library that contain data files. Then I ran it on stable Calibre and it took more or less the same time to return the results.

edit: takes more like 15 to 17 seconds.

On the other hand, I have a "has author notes" python search kindly provided by C.haley, that runs very fast, returning 4600 titles almost instantly:

Spoiler:
template:"""python:
def evaluate(book, context):
db = context.db.new_api
authors_with_notes = context.globals.get('authors_with_notes')
if authors_with_notes is None:
print('authors notes is none')
authors_with_notes = db.get_all_items_that_have_notes('authors')
context.globals['authors_with_notes'] = authors_with_notes
context.globals['item_name_map'] = db.get_item_name_map('authors')
item_name_map = context.globals['item_name_map']
for aut in book.authors:
if item_name_map.get(aut) in authors_with_notes:
return '1'
return ''#@#:b:True"""

Last edited by Comfy.n; 03-06-2024 at 09:15 PM. Reason: add more precise timing
Comfy.n is offline   Reply With Quote