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-06-2014, 04:53 AM   #1
ronbarak
Junior Member
ronbarak began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2014
Device: Laptop
Question Remembering last place in book

The Calibre documentation states "When you are in the middle of a book and close the viewer, it will remember where you stopped reading and return there the next time you open the book."

However, if the OS crashes, then next time the book that was read is opened, it opens at the beginning.

My solution currently is to make a bookmark current place - once in a while, so that I'd know the general place I was in case the above crash happens.

This is annoying.

Is there a way to get the last-paragraph-viewed in Calibre GUI, or do I need to learn the Calibre API and write an extension?


Environment:
Calibre 1.35
Windows 7
ronbarak is offline   Reply With Quote
Old 07-06-2014, 05:21 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: 40,002
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
How often is you OS crashing? I suggest your time will be much more productively spent figuring out why your OS is crashing and fixing that.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-06-2014, 06:16 AM   #3
ronbarak
Junior Member
ronbarak began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2014
Device: Laptop
Question

Quote:
Originally Posted by kovidgoyal View Post
How often is you OS crashing? I suggest your time will be much more productively spent figuring out why your OS is crashing and fixing that.
The term crashing was metaphorical: it's usually when the laptop battery is depleted and there's no available power source (e.g., while on public transportation).
Any input pertinent to my actual question (namely, is the last-page-read datum available from the GUI, or do I need to add it myself) ?
ronbarak is offline   Reply With Quote
Old 07-06-2014, 06:22 AM   #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: 40,002
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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. 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.
kovidgoyal is offline   Reply With Quote
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
Advert
Old 07-06-2014, 09:06 AM   #6
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: 40,002
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ronbarak View Post
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.
I strongly suggest you heed your computer's low battery warning instead. If your computer dies in the middle of the bookmark saving operation you could end up with a corrupted file. Bookmarks are not stored in a DB that can handle mid operation power loss.
kovidgoyal is offline   Reply With Quote
Old 07-06-2014, 09:19 AM   #7
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
I strongly suggest you heed your computer's low battery warning instead. If your computer dies in the middle of the bookmark saving operation you could end up with a corrupted file. Bookmarks are not stored in a DB that can handle mid operation power loss.
When implementing such a solution, it'd be implemented as an atomic process, namely, the previous bookmark is deleted only once the current bookmark is confirmed written.
ronbarak is offline   Reply With Quote
Old 07-06-2014, 09:28 AM   #8
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,536
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by ronbarak View Post
When implementing such a solution, it'd be implemented as an atomic process, namely, the previous bookmark is deleted only once the current bookmark is confirmed written.
Not that easy to achieve an atomic operation as the bookmark information is stored inside the .epub file which is a composite file. You cannot do a partial update of such a file and expect it to not be corrupted
itimpi is offline   Reply With Quote
Reply

Tags
api, bookmark, calibre

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free book (ended) - Remembering Christmas [Christian Fiction] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 6 12-03-2014 12:20 PM
PW not remembering book location Sapa888 Devices 3 04-10-2013 07:56 PM
K3 losing my place in the book Lazybones Amazon Kindle 11 08-19-2011 10:10 AM
302 Not remembering last book opened etc. guyanonymous PocketBook 7 02-11-2011 12:07 AM
E-book viewer not properly remembering book position sherman Calibre 9 02-20-2010 06:12 PM


All times are GMT -4. The time now is 12:41 PM.


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