mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 19:54:18 +02:00
Filter ondevice, comments, and non-displayed custom fields from sort box
This commit is contained in:
parent
9462245394
commit
0acd342fef
1 changed files with 7 additions and 0 deletions
|
|
@ -216,7 +216,14 @@ def browse_template(self, sort, category=True, initial_search=''):
|
|||
scn += 'list'
|
||||
fm = self.db.field_metadata
|
||||
sort_opts, added = [], set([])
|
||||
displayed_custom_fields = custom_fields_to_display(self.db)
|
||||
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']
|
||||
if n not in added:
|
||||
added.add(n)
|
||||
|
|
|
|||
Loading…
Reference in a new issue