Fails to Archive Any Highlights
Closed this issue ยท 11 comments
Using KOHighlights (portable) 2.1.1.0 on Windows 11, after I successfully load highlights from my ereader, attempting to archive them produces no effect and the following repeated error in the log:
Crash@2024-09-24 16:52:24
Traceback (most recent call last):
File "main.py", line 1121, in create_row
File "main.py", line 1208, in get_item_stats
KeyError: 'highlight'
There are no other errors in the log.
What version of KOReader are you using?
There are major changes after 2024.07 in the highlights part of the metadata.
I might missed something..
Can you upload the relevant .sdr folder here to check?
I am using 2024.07. Attempting to archive a single book's highlights (I'd been trying to do it as a batch) produced a log terminating with:
Crash@2024-09-25 16:35:54
Traceback (most recent call last):
File "main.py", line 1038, in on_archive
KeyError: 'stats'
The relevant sdr directory is attached.
Canticle For Leibowitz, A - Walter M. Miller.sdr.zip
Thanks.
Hmm..
This is a different error.
I think it has to do with the statistics plug-in being disabled.
I can guard against that check (I should already have done it, I know..)
But the other error was more concerning.
Is it possible to find what book is generating it and upload the .sdr here?
I'm preparing a beta that has some other fixes and additions, so it will be nice if I could include a fix for the other error too..
Archiving highlights from a single source or multiple sources provided none are an "OLD TYPE FILE" now works. Attempting to archive any of these or any combination including these fails.
A combination of one valid highlight and one "old type" seems to produce the following log:
Crash@2024-09-25 23:32:34
Traceback (most recent call last):
File "main.py", line 908, in file_selection_update
File "main.py", line 681, in on_file_table_itemClicked
File "main.py", line 1285, in populate_high_list
File "main.py", line 1334, in get_highlights_from_data
KeyError: 'highlight'
Crash@2024-09-25 23:32:36
Traceback (most recent call last):
File "main.py", line 429, in keyPressEvent
File "main.py", line 1035, in on_archive
KeyError: 'highlight'
Archiving a single "old type" produced:
Crash@2024-09-25 23:32:08
Traceback (most recent call last):
File "main.py", line 429, in keyPressEvent
File "main.py", line 1035, in on_archive
KeyError: 'highlight'
And archiving two "old types" and no valid types produced:
Crash@2024-09-25 23:33:42
Traceback (most recent call last):
File "main.py", line 908, in file_selection_update
File "main.py", line 681, in on_file_table_itemClicked
File "main.py", line 1285, in populate_high_list
File "main.py", line 1334, in get_highlights_from_data
KeyError: 'highlight'
Crash@2024-09-25 23:33:43
Traceback (most recent call last):
File "main.py", line 908, in file_selection_update
File "main.py", line 681, in on_file_table_itemClicked
File "main.py", line 1285, in populate_high_list
File "main.py", line 1334, in get_highlights_from_data
KeyError: 'highlight'
Crash@2024-09-25 23:33:44
Traceback (most recent call last):
File "main.py", line 908, in file_selection_update
File "main.py", line 681, in on_file_table_itemClicked
File "main.py", line 1285, in populate_high_list
File "main.py", line 1334, in get_highlights_from_data
KeyError: 'highlight'
Crash@2024-09-25 23:33:45
Traceback (most recent call last):
File "main.py", line 908, in file_selection_update
File "main.py", line 681, in on_file_table_itemClicked
File "main.py", line 1285, in populate_high_list
File "main.py", line 1334, in get_highlights_from_data
KeyError: 'highlight'
Crash@2024-09-25 23:33:47
Traceback (most recent call last):
File "main.py", line 429, in keyPressEvent
File "main.py", line 1035, in on_archive
KeyError: 'highlight'
SDR directories used in this test are below.
SDR-examples.zip
Thanks for your work!
Hmm..
I had forgot about these very old metadata types.
All the issues are addressed now.
After some additions I'm planning for the following days, I'll upload a beta here to check..
Thank you for the heads up! ๐
Terrific. I must have missed whenever the sidecar data got changed. Was there a recommendation to migrate it to the new type?
If you update KOReader it will automatically convert the metadata to the newer format when you open the book.
The latest important change happened with the 2024.7 version.
But the only reason to do so, is if you sync highlights between different devices (can't do that if they have different metadata format)
Check out this beta to see if all the problems are now solved (and no new problems are introduced ๐ )..
Fixed in v2.2.0.0
Thanks! Apologies for disappearing for a bit.