mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix search for fields with numeric values #5356
This commit is contained in:
parent
96c95279d1
commit
1dd8c22239
@ -303,6 +303,7 @@ class ResultCache(SearchQueryParser):
|
||||
IS_CUSTOM = []
|
||||
for x in range(len(self.FIELD_MAP)): # build a list containing '' the size of FIELD_MAP
|
||||
IS_CUSTOM.append('')
|
||||
IS_CUSTOM[self.FIELD_MAP['rating']] = 'rating' # normal and custom ratings columns use the same code
|
||||
for x in self.custom_column_label_map: # add custom columns to MAP. Put the column's type into IS_CUSTOM
|
||||
if self.custom_column_label_map[x]['datatype'] != "datetime":
|
||||
MAP[x] = self.FIELD_MAP[self.custom_column_label_map[x]['num']]
|
||||
@ -370,11 +371,6 @@ class ResultCache(SearchQueryParser):
|
||||
matches.add(item[0])
|
||||
continue
|
||||
|
||||
if rating_query:
|
||||
if (loc == MAP['rating'] and rating_query == int(item[loc])):
|
||||
matches.add(item[0])
|
||||
continue
|
||||
|
||||
if IS_CUSTOM[loc] == 'rating':
|
||||
if rating_query and rating_query == int(item[loc]):
|
||||
matches.add(item[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user