Should be enough for some inspired soul to write a plugin. A tremendous Christmas gift to the community if anyone is interested. I imagine such a plugin would need to:
- Correlate filename in Dropbox & book within Calibre library
- Compare timestamps of book position updates from Calibre vs. Moon+ to decide which one is most recent
- Offer to update position based on "more recent" page# (assumes clocks are in sync)
To map x, y & z into something usable by the plugin requires an understanding of each of the supported formats. The following is just guesswork based on examination of several books in pdf and epub formats. I invite further comment.
- Moon+ .po format appears to be: uuuuuuuuuuuuu*x@y#zzzzz:pp.p%, where u is a 13-digit Unix epoch timestamp in milliseconds, p is the progress percentage, and x, y & z are indices into the structure of the document
- i think percentage is only for display purposes and is not useful for navigation to the position
- i think x in a pdf is logical page#
- i think x in an epub or mobi is a section index (could be from content.opf, Nth zero-based <itemref> which in turn can locate <item>, and from there, the link to the file)
- i think y in an epub or mobi is a secondary section index (in most books, is 0, but when non-zero, x seems to be the Nth zero-based <itemref> from which 0% is computed, whereas y identifies the <itemref> currently being read)
- i think z (absent in pdf) is a zero-based character# offset from the beginning of the file for the identified section, i.e. x, or if y is non-zero, then y instead
I looked at toc.ncx navMap as an alternate way of finding the section, but then "y" doesn't make sense, i.e. in books which don't have every file that is listed in the <manifest> also listed in toc.ncx, "y" doesn't seem to correspond to anything useful within toc.ncx.
Last edited by SynrG; 12-23-2017 at 09:40 AM.
|