Originally Posted by koenieee
I was thinking to create some sort script that synces epubs booksmarks (not the offical kobo books) with my android smartphone.
Does anyone know where the Kobo saves the bookmarks?
In the sqllite database I guess?
The bookmarks are in three places depending on what you want.
The annotations and highlights are in the annot file that textchimp is using. These are also in a database table called "Bookmark". Hopefully any ADE based reader could reuse the file. Also, the file on the Kobo's takes precedence. If you delete the records in the table, the annotations are loaded from the file. If you delete the file, the annotations are removed.
The current place in the book is stored in the "content" table. Each book has a row with ContentType=6. Books that are being read have a value in the column "ChapterIDBookmarked". This has a reference to the current chapter. The reference is the key to the content table for a ContentType=9 row. This row has a value in the column "adobe_location". This is the current location in the chapter. The following SQL will show the current position for all sideloaded books:
SELECT c1.Title, c1.Attribution, c1.DateLastRead, c1.ChapterIDBookmarked, c1.ReadStatus, c1.___PercentRead, c2.ContentId, c2.Title, c2.adobe_location
FROM content c1 join content c2 on c1.ChapterIDBookmarked = c2.ContentID
where c2.bookid like 'file:///mnt/onboard%'
Decoding the value in adobe_location is the only problem in this data. An example for me is "OEBPS/138508.xhtml#point(/1/4/278/1:222)". The first part is the name of a file inside the epub. The point must translate to some position in the file, but I haven't bothered to work out exactly what it means.