mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 08:43:37 +02:00
Use the template cache to speed up evaluation when searching using templates.
This commit is contained in:
parent
740bfd26db
commit
dd7a28abb2
1 changed files with 4 additions and 1 deletions
|
|
@ -643,9 +643,12 @@ def fi(default_value=None):
|
|||
matchkind, query = _matchkind(query, case_sensitive=case_sensitive)
|
||||
matches = set()
|
||||
error_string = '*@*TEMPLATE_ERROR*@*'
|
||||
template_cache = {}
|
||||
for book_id in candidates:
|
||||
mi = self.dbcache.get_proxy_metadata(book_id)
|
||||
val = mi.formatter.safe_format(template, {}, error_string, mi)
|
||||
val = mi.formatter.safe_format(template, {}, error_string, mi,
|
||||
column_name='search template',
|
||||
template_cache=template_cache)
|
||||
if val.startswith(error_string):
|
||||
raise ParseException(val[len(error_string):])
|
||||
if sep == 't':
|
||||
|
|
|
|||
Loading…
Reference in a new issue