From 35bfaab6699963578d11a6aa527f7802ae4df5a4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Dec 2010 15:47:56 -0700 Subject: [PATCH] Fix #8047 (Saved Searches not working in Web Browser) --- src/calibre/library/server/browse.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index b1c4a4c2f9..afc20ba21c 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -556,18 +556,19 @@ class BrowseServer(object): ids = self.search_cache('search:"%s"'%which) except: raise cherrypy.HTTPError(404, 'Search: %r not understood'%which) - all_ids = self.search_cache('') - if category == 'newest': - ids = all_ids - hide_sort = 'true' - elif category == 'allbooks': - ids = all_ids else: - q = category - if q == 'news': - q = 'tags' - ids = self.db.get_books_for_category(q, cid) - ids = [x for x in ids if x in all_ids] + all_ids = self.search_cache('') + if category == 'newest': + ids = all_ids + hide_sort = 'true' + elif category == 'allbooks': + ids = all_ids + else: + q = category + if q == 'news': + q = 'tags' + ids = self.db.get_books_for_category(q, cid) + ids = [x for x in ids if x in all_ids] items = [self.db.data._data[x] for x in ids] if category == 'newest':