From 4c207d9b6f071f36e0507b1a5e60d2cee5e14f3f Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 16 Oct 2010 14:54:03 +0100 Subject: [PATCH] Remove non-displayable categories from the home page --- src/calibre/library/server/browse.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index a122f539c6..be8b55e648 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -267,6 +267,7 @@ class BrowseServer(object): def getter(x): return category_meta[x]['name'].lower() + displayed_custom_fields = custom_fields_to_display(self.db) for category in sorted(categories, cmp=lambda x,y: cmp(getter(x), getter(y))): if len(categories[category]) == 0: @@ -276,6 +277,8 @@ class BrowseServer(object): meta = category_meta.get(category, None) if meta is None: continue + if meta['is_custom'] and category not in displayed_custom_fields: + continue cats.append((meta['name'], category)) cats = ['
  • {0}/browse/category/{1}
  • '\ .format(xml(x, True), xml(quote(y)), xml(_('Browse books by')))