From 1dd8c22239a98ebba8793c20af5296c215cb1ccb Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 23 Apr 2010 21:02:26 +0100 Subject: [PATCH] Fix search for fields with numeric values #5356 --- src/calibre/library/caches.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 4a38d386a6..eb456241ce 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -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])