![]() |
#1 |
Junior Member
![]() 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() 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?
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can do all three of those via python.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() 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)?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() 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? |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |