Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2022, 01:54 PM   #1
SeanDeNigris
Junior Member
SeanDeNigris began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2022
Device: none
Current Location - Query Programmatically

Is there any way to get the current viewer location from outside the program? ?

I reviewed the docs for the command line tools, did a web search, and nosed around the forum here, but couldn't find anything definitive. The closest I came was a forum post referencing a config file storing the information, but it didn't say where the file was or if it could be used for this purpose.

TIA
SeanDeNigris is offline   Reply With Quote
Old 09-16-2022, 10:41 PM   #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: 45,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not while its open. After you close it the last read position is tored in 3 places.

1) Inside the file iteself if it s an EPUB file and you havent disabled saving of annotations inside ebook files

2) In the metadata.db in the calibre lirbary folder if you are reading a book froma calibre library.

3) In the config file referenced above.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-17-2022, 06:19 AM   #3
SeanDeNigris
Junior Member
SeanDeNigris began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2022
Device: none
Thanks. What about via python? Is there any API to query the current viewer location?
SeanDeNigris is offline   Reply With Quote
Old 09-17-2022, 11:17 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: 45,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can do all three of those via python.
kovidgoyal is offline   Reply With Quote
Old 09-19-2022, 09:51 AM   #5
SeanDeNigris
Junior Member
SeanDeNigris began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2022
Device: none
Good news! But if I understand correctly, those three methods only work if the view is closed, right? My use case needs to get the location while the view is open. Is there any way to do that (preferably via python)?
SeanDeNigris is offline   Reply With Quote
Advert
Old 09-19-2022, 12:09 PM   #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: 45,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The information is saved periodically though I cant recall of the top of my head if it is ina ll 3 places or only in the viewer config file, so you can query them. IIRC if no page turn has occurred for a few seconds the location is saved.
kovidgoyal is offline   Reply With Quote
Old 09-20-2022, 11:59 AM   #7
SeanDeNigris
Junior Member
SeanDeNigris began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2022
Device: none
Thanks for the dialogue on this.

So it sounds like the current status is that the current location is available via Python, but there is no guarantee that it's correct because it may wait for several seconds to ellapse w/o a page turn before updating the information. Is that correct?

My use case is to create a citation for the current position from outside the app, so I don't think the current functionality (if correctly described) will work for me. I would need to be able to count on it being accurate.

I was hoping for a programmatic equivalent to the "Go to location" GUI feature, or (maybe even better) reference mode location.

Are you open to a feature request?
SeanDeNigris is offline   Reply With Quote
Old 09-20-2022, 07:12 PM   #8
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: 45,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm afraid I dont have any interest in implementing some way for un-related programs to query the state of the viewer. That would require setting up an IPC mechanism, which is way too much work, at least for me.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Text Search - Allow interrupting/pausing current query Comfy.n Calibre 7 08-12-2022 01:22 AM
Does Moon Reader have ability to show highlights starting from current location? 2scre Android Devices 7 12-31-2020 11:18 PM
Aura H2O Change the text of "Current Reading Location Column" pippo53 Kobo Reader 4 01-12-2016 06:55 AM
Bookmarks/Current Location in a library sync'd with OneDrive cfink Development 6 10-01-2015 01:48 PM
PRS-600 Programmatically handling collections wakata Sony Reader Dev Corner 1 07-10-2011 06:19 PM


All times are GMT -4. The time now is 03:32 AM.


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