mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix incorrect sorting of highlights from the first internal file of a book. Fixes #1972069 [Annotations Sometimes List Out Of Order](https://bugs.launchpad.net/calibre/+bug/1972069)
This commit is contained in:
parent
5e5cd0f4a7
commit
bcb501b6de
@ -277,7 +277,8 @@ class Highlights(QTreeWidget):
|
||||
|
||||
def cfi_key(h):
|
||||
cfi = h.get('start_cfi')
|
||||
return (h.get('spine_index') or defval[0], cfi_sort_key(cfi)) if cfi else defval
|
||||
si = h.get('spine_index')
|
||||
return (defval[0] if si is None else si, cfi_sort_key(cfi)) if cfi else defval
|
||||
|
||||
return sorted(highlights, key=cfi_key)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user