Skip to content

Annotations: sync between devices#13372

Merged
hius07 merged 5 commits into
koreader:masterfrom
hius07:anno-sync
Mar 10, 2025
Merged

Annotations: sync between devices#13372
hius07 merged 5 commits into
koreader:masterfrom
hius07:anno-sync

Conversation

@hius07

@hius07 hius07 commented Mar 6, 2025

Copy link
Copy Markdown
Member

Exports annotations to a lua file in the assigned folder (default - book metadata folder):
-automatically on book closing, or
-manually from the Bookmark list, or with a gesture/profile.

Imports annotations on book opening.

Export filename is <book-filename>.annotations.lua.
The file should be moved to other device manually or by a syncing program.

Syncing logic:
Checks for correspondence between old and new annotations (by highlight start and end positions).
-if there is no old annotation, the new one is added;
-if new annotation is newer than the old one, the old one is replaced;
-if there is no new annotation corresponding to the old one, and the export datetime is newer than the old annotation datetime, the old one is removed.

1

2


This change is Reviewable

@Frenzie Frenzie modified the milestone: 2025.03 Mar 6, 2025

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

@hius07 hius07 merged commit 5cf57dc into koreader:master Mar 10, 2025
@hius07 hius07 deleted the anno-sync branch March 10, 2025 06:11
@hius07 hius07 added this to the 2025.02 milestone Mar 10, 2025
@notDavid

notDavid commented Mar 10, 2025

Copy link
Copy Markdown

@hius07 Hi there, noob question: how is this different from the .sdr folder with the metadata.epub.lua file ?

@zephyros-dev

zephyros-dev commented Jun 4, 2025

Copy link
Copy Markdown

I think this feature is for separating configurations (which might be device specifics like font size) with annotations (which is synced to all devices). Personally I uses syncthing across my phone and PC so this is very handy. I do have 2 questions though:

  1. Does the Save book metadata interval settings include the new annotation file? I currently host the koreader on the server and forgot to close the book sometimes, and the auto-save feature is handy in making sure the metadata are updated.
  2. Is there a way to do a whole library annotations conversion? I think currently only the books that are opened will be converted.

@hius07

hius07 commented Jun 4, 2025

Copy link
Copy Markdown
Member Author
  1. Yes if you have enabled Export annotations on book closing.
  2. No. But Export supports old highlights/bookmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants