mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
/browse: Filter out some entries from the book list sort combobox
This commit is contained in:
commit
7362cc28f4
@ -217,7 +217,14 @@ class BrowseServer(object):
|
|||||||
scn += 'list'
|
scn += 'list'
|
||||||
fm = self.db.field_metadata
|
fm = self.db.field_metadata
|
||||||
sort_opts, added = [], set([])
|
sort_opts, added = [], set([])
|
||||||
|
displayed_custom_fields = custom_fields_to_display(self.db)
|
||||||
for x in fm.sortable_field_keys():
|
for x in fm.sortable_field_keys():
|
||||||
|
if x == 'ondevice':
|
||||||
|
continue
|
||||||
|
if fm[x]['is_custom'] and x not in displayed_custom_fields:
|
||||||
|
continue
|
||||||
|
if x == 'comments' or fm[x]['datatype'] == 'comments':
|
||||||
|
continue
|
||||||
n = fm[x]['name']
|
n = fm[x]['name']
|
||||||
if n not in added:
|
if n not in added:
|
||||||
added.add(n)
|
added.add(n)
|
||||||
@ -294,7 +301,7 @@ class BrowseServer(object):
|
|||||||
|
|
||||||
displayed_custom_fields = custom_fields_to_display(self.db)
|
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:
|
||||||
continue
|
continue
|
||||||
if category == 'formats':
|
if category == 'formats':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user