Quote:
Originally Posted by ownedbycats
@chaley - After updating Calibre to source, has_data() broke with this error:
EXCEPTION: Error in function evaluate on line 4 : AttributeError - 'Cache' object has no attribute 'list_extra_files_matching'
What changed?
EDIT: Maybe this change https://github.com/kovidgoyal/calibr...095525b6e24e92
|
Yes, because of that commit. The API was improved for this use case, making it faster.
The template should be:
Code:
python:
def evaluate(book, context):
db = context.db.new_api
files = db.list_extra_files(book.id, pattern='data/**/*', use_cache=True)
return 'Yes' if files else ''
Note: I will be adding template functions for queries about extra files.