View Single Post
Old 07-06-2014, 07:34 AM   #5
ronbarak
Junior Member
ronbarak began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2014
Device: Laptop
Quote:
Originally Posted by kovidgoyal View Post
Surely your computer has a low battery warning? So quit the reader, and it will save the last read position.

The concept of trying to save a last read position in a way that is robust against "crashing" as you put it, is meaningless. To do that you would need to be saving the last read position continuously every spare cycle your CPU has on the off chance that your computer will "crash" on the next CPU cycle.
No need to devote "continuously every spare cycle your CPU." Once every 2 minutes would be quite sufficient (at worst, one would have to re-scan the last 2 minutes of reading to get to the last place read, and on average, it'd be only one minute of re-scanning).

Quote:
Originally Posted by kovidgoyal View Post
The best you can do is save it continuously at some fixed time interval. And no last read position is not available anywhere outside the viewer instance you are reading in.
Okay, I see I'd have to take a look at your API, and create a hook that will save the current reading paragraph (CRP) as another bookmark once every X minutes, and load that position next time the book is loaded, in case CRP is not at position 0 (the beginning), but Calibre tries to load the book at position 0.
ronbarak is offline   Reply With Quote