Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2017, 02:39 AM   #1
rszasz
Member
rszasz began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: Kindle 4thGen
adding azw3 annotation support to kindle driver

The azw3's annotation sidecar seems fairly straight forward to deal with, so I'm going to make an attempt to extend the kindle driver's annotation fetching support.

The .han file is just a plaintext JSON container so I'll post the contents of one below. Hopefully the location numbers can just be used with the existing code and don't need conversion.


{"payload":{"key":"c848d0d0-af95-4ffb-8dfd-c505c468ab0b","type":"EBOK","records":[{"endPosition":"42844","startPosition":"42616","la stModificationTime":"2017-07-31 06:21:29.413","type":"kindle.highlight"},{"text":" test","endPosition":"42948","startPosition":"42942 ","lastModificationTime":"2017-07-31 06:21:29.413","type":"kindle.note"},{"lastModifica tionTime":"2017-07-31 06:21:29.413","type":"kindle.lpr","location":"4246 1"}],"guid":"Around_the_World_in_Eighty_Days:34B1AEF9" ,"acr":"Around_the_World_in_Eighty_Days:34B1AEF9"} ,"md5":"7c6c54fd763a1581def4750bc85bf2d3"}
rszasz is offline   Reply With Quote
Old 07-31-2017, 07:37 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC the kindle driver just has two or three simple functions that deal with annotations. Should be easy to modify. Look in kindle/driver.py
kovidgoyal is offline   Reply With Quote
Old 07-31-2017, 12:12 PM   #3
rszasz
Member
rszasz began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: Kindle 4thGen
Thanks

The driver portion was fairly simple just needed to add the han format to a few places. I'm not totally clear what DELETE_EXTS is for, but I assume its files not to transfer, so I added .han to that as well.

bookmark.py is where I'm currently stalled as I don't know how the location/position number is generated or how to calculate the percentage complete using it.

I can get location numbers on the kindle itself, and then the data stored on in the .han file. Calculating and testing the Magic Constant should be fairly straightforward, I just need to figure out how to find the length of the azw3 in either kindle display location or the .han location formats
rszasz is offline   Reply With Quote
Old 07-31-2017, 12:50 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
DELETE_EXTS is a list of additional extensions to try to delete when deleting a book from the device.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ideas for adding an annotation to an ebook u238110 Workshop 2 03-28-2015 12:18 AM
Converting to fb2 - adding annotation. Saioko Conversion 2 05-01-2014 12:02 AM
[Kindle Touch] adding support for other ebook types LittleLui Kindle Developer's Corner 9 03-07-2012 06:57 AM
Kindle DX and Kindle 3 annotation support djk80 Amazon Kindle 0 08-31-2010 03:29 PM
Epub Revision - annotation support Nate the great ePub 3 04-09-2010 11:12 PM


All times are GMT -4. The time now is 08:17 AM.


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