mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove non-displayable categories from the home page
This commit is contained in:
parent
468754e7ab
commit
4c207d9b6f
@ -267,6 +267,7 @@ class BrowseServer(object):
|
|||||||
def getter(x):
|
def getter(x):
|
||||||
return category_meta[x]['name'].lower()
|
return category_meta[x]['name'].lower()
|
||||||
|
|
||||||
|
displayed_custom_fields = custom_fields_to_display(self.db)
|
||||||
for category in sorted(categories,
|
for category in sorted(categories,
|
||||||
cmp=lambda x,y: cmp(getter(x), getter(y))):
|
cmp=lambda x,y: cmp(getter(x), getter(y))):
|
||||||
if len(categories[category]) == 0:
|
if len(categories[category]) == 0:
|
||||||
@ -276,6 +277,8 @@ class BrowseServer(object):
|
|||||||
meta = category_meta.get(category, None)
|
meta = category_meta.get(category, None)
|
||||||
if meta is None:
|
if meta is None:
|
||||||
continue
|
continue
|
||||||
|
if meta['is_custom'] and category not in displayed_custom_fields:
|
||||||
|
continue
|
||||||
cats.append((meta['name'], category))
|
cats.append((meta['name'], category))
|
||||||
cats = ['<li title="{2} {0}">{0}<span>/browse/category/{1}</span></li>'\
|
cats = ['<li title="{2} {0}">{0}<span>/browse/category/{1}</span></li>'\
|
||||||
.format(xml(x, True), xml(quote(y)), xml(_('Browse books by')))
|
.format(xml(x, True), xml(quote(y)), xml(_('Browse books by')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user