mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the inlist_field operator work on identifiers so it has the same result as inlist
This commit is contained in:
parent
a4c4a8fa33
commit
a2b38bd882
@ -1403,6 +1403,11 @@ class _Interpreter:
|
||||
if res is None or not isinstance(res, (list, tuple, set, dict)):
|
||||
self.error(_("Field '{0}' is either not a field or not a list").format(right), prog.line_number)
|
||||
pat = re.compile(left, flags=re.I)
|
||||
if isinstance(res, dict): # identifiers
|
||||
for k,v in res.items():
|
||||
if re.search(pat, f'{k}:{v}'):
|
||||
return '1'
|
||||
else:
|
||||
for v in res:
|
||||
if re.search(pat, v):
|
||||
return '1'
|
||||
|
Loading…
x
Reference in New Issue
Block a user