This commit is contained in:
Kovid Goyal 2022-05-25 08:36:53 +05:30
parent bcb501b6de
commit 26ecfcf28a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -277,8 +277,8 @@ class Highlights(QTreeWidget):
def cfi_key(h):
cfi = h.get('start_cfi')
si = h.get('spine_index')
return (defval[0] if si is None else si, cfi_sort_key(cfi)) if cfi else defval
si = h.get('spine_index', defval[0])
return (si, cfi_sort_key(cfi)) if cfi else defval
return sorted(highlights, key=cfi_key)