Fix #7876 (Books excluded by saved search via tag are visible on server)

This commit is contained in:
Kovid Goyal 2010-12-14 21:22:30 -07:00
parent a1c7d0615c
commit ef23a7c8c4

View File

@ -552,16 +552,18 @@ class BrowseServer(object):
ids = self.search_cache('search:"%s"'%which) ids = self.search_cache('search:"%s"'%which)
except: except:
raise cherrypy.HTTPError(404, 'Search: %r not understood'%which) raise cherrypy.HTTPError(404, 'Search: %r not understood'%which)
elif category == 'newest': all_ids = self.search_cache('')
ids = self.search_cache('') if category == 'newest':
ids = all_ids
hide_sort = 'true' hide_sort = 'true'
elif category == 'allbooks': elif category == 'allbooks':
ids = self.search_cache('') ids = all_ids
else: else:
q = category q = category
if q == 'news': if q == 'news':
q = 'tags' q = 'tags'
ids = self.db.get_books_for_category(q, cid) 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] items = [self.db.data._data[x] for x in ids]
if category == 'newest': if category == 'newest':