READING / WRITING ANNOTATIONS
Quote:
Originally Posted by Frapi
I have an old broken PB632 this many notes, and eventually manage to get its books.db file, so I want to add these notes & highlight into my new pb632...
|
The books.db can actually be read & write
Just make sure (for instance by rebooting the reader before) that all the wal (db logs, see
https://www.sqlite.org/wal.html ) are actually synced into books.db, so no more books.db-wal or books.db-shm in /mnt/ext1/system/config/
Then copy books.db on a computer
any sqlite editor allows you to add notes or highlights.
1) create a new item,
ParentID : book's OID
TypeID : 4 (book_mark)
State : 0 (?)
TimeAlt : a timestamp
HashUUID : an UUID
2) Then create parts in Tags
For note, :
ItemId : item's OID you just created
TagID : 101 (for book_mark)
Val : json, eg {"anchor":"pbr:/word?page=1&offs=398","created":1687936650}, with pos on the book (page/offset) and same timestamp
TimeEdt : same timestamp
then
TagId : 102 (for type)
Val : note
TagId : 104 (for quotation)
Val : json, eg {"begin":"pbr:/word?page=1&offs=398","end":"pbr:/word?page=1&over=484","text":"Nous avons toujours cru que les vies de nos enfants seraient meilleures que les nôtres."} ( ! no timestamp there)
TagID : 105 (for text)
Val : json eg {"text":"Et maintenant en 2023 on en est encore plus sûrs que ça ne sera pas le cas !"}
[optional I think]
TagID : 106 (for color)
val: cian
For highlight : same, but no 105, and 102 is "highlight"
Then copy back books.db on reader's /mnt/ext1/system/config/
(with a rooted reader it might be more convenient)
reboot
Definitely, it's not easy from a printed book to identify page & offset, but in my case I wanted to re-insert notes from a previous reader's books.db database, so it's OK.
Some caveats :
- Not quite sure how we should build UUID, when from scratch... might be dependent from other fields ?
- books you want to add notes for MUST have been opened at least once on the reader (they are not listed in books table otherwise)
For my usage, I will build a code
- extracting all note and highlight from a books.db,
- inserting all this in an other books.db
Will give it somewhere, you may reuse/fork
--
Frapi