Skip to content

Commit

Permalink
Ensure series_index sorts after series
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jun 26, 2024
1 parent 218ca90 commit 0f49b15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/calibre/gui2/catalog/catalog_csv_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ def key(x):

self.db_fields.clear()
for x in sorted(self.all_fields, key=key):
i = ListWidgetItem(x, name(x) + ' (%s)' % x, cpos.get(x, sys.maxsize), self.db_fields)
pos = cpos.get(x, sys.maxsize)
if x == 'series_index':
pos = cpos.get('series', sys.maxsize)
ListWidgetItem(x, name(x) + ' (%s)' % x, pos, self.db_fields)
if x.startswith('#') and fm[x]['datatype'] == 'series':
x += '_index'
ListWidgetItem(x, name(x) + ' (%s)' % x, i.position_in_booklist, self.db_fields)
ListWidgetItem(x, name(x) + ' (%s)' % x, pos, self.db_fields)

# Restore the activated fields from last use
for x in range(self.db_fields.count()):
Expand Down

0 comments on commit 0f49b15

Please sign in to comment.