diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 7e80213aff..f1d9b9785c 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -623,8 +623,6 @@ class BrowseServer(object): except: raise cherrypy.HTTPError(404, 'Search: %r not understood'%which) else: - if fm.get(category, {'datatype':None})['datatype'] == 'composite': - cid = cid.decode('utf-8') all_ids = self.search_cache('') if category == 'newest': ids = all_ids @@ -632,6 +630,8 @@ class BrowseServer(object): elif category == 'allbooks': ids = all_ids else: + if fm.get(category, {'datatype':None})['datatype'] == 'composite': + cid = cid.decode('utf-8') q = category if q == 'news': q = 'tags'