Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2017, 03: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
Advert
Old 07-31-2017, 08: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: 32,033
Karma: 9797962
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, 01: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, 01: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: 32,033
Karma: 9797962
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:18 AM
Converting to fb2 - adding annotation. Saioko Conversion 2 05-01-2014 01:02 AM
[Kindle Touch] adding support for other ebook types LittleLui Kindle Developer's Corner 9 03-07-2012 07:57 AM
Kindle DX and Kindle 3 annotation support djk80 Amazon Kindle 0 08-31-2010 04:29 PM
Epub Revision - annotation support Nate the great ePub 3 04-10-2010 12:12 AM


All times are GMT -4. The time now is 10:02 AM.


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