Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2026, 10:40 AM   #1
foresle
Junior Member
foresle began at the beginning.
 
foresle's Avatar
 
Posts: 1
Karma: 10
Join Date: Nov 2022
Device: PB628
Post knyga — relink PocketBook notes after editing EPUB metadata

Hi all,

I wrote a small CLI tool to scratch a long-standing itch with PocketBook readers and figured it might be useful to others here.

The problem

PocketBook identifies books in its on-device library by the MD5 hash of the whole EPUB file, not by ISBN or any stable identifier embedded in the OPF. The moment you touch metadata — fix a typo in the author field, replace the cover, normalize the title — the file hash changes. The device then treats the file as a brand-new book, and every highlight, bookmark and note you made silently becomes an orphan. The annotations are still in the device databases, they just point at a hash that no longer matches anything on disk.

The fix

knyga rewrites the old hash to the new hash inside PocketBook's databases so the existing annotations reattach to the re-tagged file. No re-reading, no manually re-creating highlights.

The intended workflow is:

1. Connect the PocketBook over USB.
2. Copy the EPUB off the device to your computer — this is the "old" file, the one whose hash the device already knows and has notes against.
3. Make a duplicate of it and edit the metadata in the duplicate. This is the "new" file.
4. Run "knyga", passing both files (old + new) as arguments. The tool hashes both, backs up the relevant device databases, and replaces the old hash with the new one wherever it appears.
5. Copy the edited file onto the device. The existing notes are now linked to it.

Demo / links

- Source and README: https://crates.io/crates/knyga
- Short walkthrough video: https://peertube.in.ua/w/81NSTkvzFCJAEay9zpDGPd

Caveats

- Tested on my own device (Pocket Book 628) and library

Feel free to ask if anything is unclear, and any feedback or bug reports are very welcome.
foresle is offline   Reply With Quote
Old 05-02-2026, 05:26 AM   #2
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 694086
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Nice one, only had a look at that video and it seems very helpful. Will not test it though since my books are on a win10 machine and I don't use annotations very often and KoReader is the standard reader I'm using.
nhedgehog is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk editing html in notes.db Comfy.n Library Management 20 03-10-2024 10:31 AM
Does editing metadata affect the EPUB itself? Cactus Chef Calibre 2 05-03-2020 10:31 PM
Editing Metadata without Compromising Notes and Highlightes in iBooks marsh494 Sigil 9 05-29-2018 05:21 PM
Change metadata order when sending epub to device (Pocketbook 626) Cmely Devices 0 09-03-2015 03:53 AM


All times are GMT -4. The time now is 05:32 PM.


MobileRead.com is a privately owned, operated and funded community.