mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DO not change the query value while looping
This commit is contained in:
parent
4787801c0d
commit
74d1e247f1
@ -405,6 +405,7 @@ class SearchFilter(SearchQueryParser):
|
||||
|
||||
for sr in self.srs:
|
||||
for locvalue in locations:
|
||||
final_query = query
|
||||
accessor = q[locvalue]
|
||||
if query == 'true':
|
||||
# True/False.
|
||||
@ -451,10 +452,10 @@ class SearchFilter(SearchQueryParser):
|
||||
elif locvalue in ('author2', 'title2'):
|
||||
m = self.IN_MATCH
|
||||
vals = re.sub(r'(^|\s)(and|not|or|a|the|is|of|,)(\s|$)', ' ', accessor(sr)).split(' ')
|
||||
query = query.lower()
|
||||
final_query = query.lower()
|
||||
else:
|
||||
vals = [accessor(sr)]
|
||||
if self._match(query, vals, m):
|
||||
if self._match(final_query, vals, m):
|
||||
matches.add(sr)
|
||||
break
|
||||
except ValueError: # Unicode errors
|
||||
|
Loading…
x
Reference in New Issue
Block a user