Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-29-2023, 07:15 AM   #16
jrw174
Connoisseur
jrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the rough
 
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
Quote:
Originally Posted by EastEriq View Post
yes thanks, with cd /mnt/ext1/applications now it works as .app as well. I have still to understand though under what refresh conditions the librarian shows the updated percentage - if just after changing view a number of times or after a device reboot. I'll keep experimenting a bit.
On a side note: I would have written the log file in /tmp/, so not to clutter the application directory.
Compliments for the work, in any event!
It seems the book percentage updates after the script. How is a good question. My guess would be a script that detects changes to the database and does an inkview refresh of sorts. There are no triggers in the explorer3.db so it must be an external script.

Good idea moving the log file. Will do
jrw174 is offline   Reply With Quote
Old 05-29-2023, 10:35 AM   #17
EastEriq
Groupie
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 185
Karma: 194590
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Good chances are that with an initial `cd /tmp` one would neither need `cd /mnt/ext1/applications` nor an absolute path for the logfile, and with an absolute path of the logfile one would not need the initial cd. Mainly a matter of taste I'd say (and perhaps, of having the logfile survive a reboot in case you fear that the script may crash the device or something the like).
EastEriq is offline   Reply With Quote
Advert
Old 06-02-2023, 11:48 AM   #18
EastEriq
Groupie
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 185
Karma: 194590
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Some minor changes:
  • use variables for pathnames to database files and logfile, for readability
  • TRIM() the title of the book. I did run into a pathological case of an epub generated from Wikisource, whose title had a trailing space. That was causing it not to be found in the Pocketbook database.
Attached Files
File Type: zip currentPageUpdate.zip (1.4 KB, 178 views)
EastEriq is offline   Reply With Quote
Old 06-29-2023, 06:19 AM   #19
the_Pan
Connoisseur
the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.
 
Posts: 95
Karma: 15430
Join Date: Mar 2015
Device: Kobo Forma, Pocketbook Era
Indeed, a very useful add-on!
the_Pan is offline   Reply With Quote
Old 07-19-2023, 08:02 AM   #20
ckdot
Junior Member
ckdot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2023
Device: Pocketbook Inkpad Color 2
Hey jrw174,

thanks for your effort!

I've found out that page_stat_data doesn't necessarly get updated once book.last_open get's updated. So there's a change that the total pages get mixed up.

I hope you don't mind that I've created a github repository with your app. This makes changes easier to track:
https://github.com/ckilb/koreader-po...sync/tree/main

I've fixed the issue I've mentioned by adding the book ID to the query that reads out the total number of pages. Also, I've simplified the queries a bit:
https://github.com/ckilb/koreader-po...1a437059515821

One question: As the log file path got changed to /tmp, how to read the log file now? If the device is attached to my computer I can't access /tmp.
ckdot is offline   Reply With Quote
Advert
Old 07-19-2023, 09:32 AM   #21
ckdot
Junior Member
ckdot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2023
Device: Pocketbook Inkpad Color 2
Me again...
I just implemented a KOReader plugin that will use the script to automatically update the reading progress.
The plugin executes the script with every page turn. KOReader isn't updating page_stat_data with every page turn so it's not perfect yet.

If you know when exactly KOReader updates that table I might trigger that event in the plugin each time. I couldn't dig in too deep yet.
ckdot is offline   Reply With Quote
Old 07-19-2023, 12:16 PM   #22
ckdot
Junior Member
ckdot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2023
Device: Pocketbook Inkpad Color 2
OK, I couldn't resist and digged deeper. (Is this already spamming?)

I found a way to trigger the logic that saves page stats. But the function implementing this only performs a database insert if the duration is > 0. I don't know how exactly the duration is measured, in the end it doesn't matter: Because of this we basically know that we can't rely on the page_stat_data always being up to date.

That's the bad news.

The good news is that it's actually super easy to get the current page number inside KOReader with each page turn. This is faster (because no database operations on page_data_stats are required) and more reliable.

The only thing I had to do is to change the script to get the page namber as an command line argument instead of fetching it from the database.
Because the script isn't meant to be executed as a stand-alone I moved it to a different location and changed the extension.

I've pushed the latest changed. Feel free to test & give me some feedback. For me it works quite well now.
ckdot is offline   Reply With Quote
Old 07-28-2023, 12:56 PM   #23
the_Pan
Connoisseur
the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.the_Pan is as sexy as a twisted cruller doughtnut.
 
Posts: 95
Karma: 15430
Join Date: Mar 2015
Device: Kobo Forma, Pocketbook Era
@ckdot
your new version works well for me, thank you!
the_Pan is offline   Reply With Quote
Old 07-31-2023, 10:27 PM   #24
conquerli
Member
conquerli began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2023
Device: PocketBook InkPad Color PB742
@ckdot

You did a great job!

My Pocket Book is Android OS (PB742). I've installed Koreader which version is koreader-android-arm-v2023.06.1. Can you make the plugin working on this device?

Thanks.
conquerli is offline   Reply With Quote
Old 08-01-2023, 01:55 AM   #25
conquerli
Member
conquerli began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2023
Device: PocketBook InkPad Color PB742
Quote:
Originally Posted by conquerli View Post
@ckdot

You did a great job!

My Pocket Book is Android OS (PB742). I've installed Koreader which version is koreader-android-arm-v2023.06.1. Can you make the plugin working on this device?

Thanks.
@jrw174,Thanks a lot for your tools.
conquerli is offline   Reply With Quote
Old 08-01-2023, 01:49 PM   #26
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,738
Karma: 11482159
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
Nice one @ckdot, works nicely
neil_swann80 is offline   Reply With Quote
Old 08-22-2023, 10:04 AM   #27
iupiter
Member
iupiter began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2022
Device: Pocketbook Inkpad Color
is there a way to auto update the plugin or do you have to manually update it with your computer?
iupiter is offline   Reply With Quote
Old 10-26-2023, 10:43 AM   #28
reuerendo
Junior Member
reuerendo began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2023
Device: PocketBook InkPad 4
Hi. If an epub book contains non-linear fragments and the “hide non-linear fragments” option is enabled in the koreader, then the book is not marked as readed at the end
reuerendo is offline   Reply With Quote
Old 11-06-2023, 12:18 PM   #29
liskin
Member
liskin began at the beginning.
 
Posts: 10
Karma: 12
Join Date: Nov 2023
Location: London
Device: PocketBook InkPad 3
Quote:
Originally Posted by reuerendo View Post
Hi. If an epub book contains non-linear fragments and the “hide non-linear fragments” option is enabled in the koreader, then the book is not marked as readed at the end
I implemented a fix for this in my fork of the plugin: https://github.com/liskin/koreader-p...48a9ae7a70fd7b
Can you test this please?
https://github.com/liskin/koreader-p...ae7a70fd7b.zip is the version with all my fixes.
liskin is offline   Reply With Quote
Old 11-10-2023, 06:51 AM   #30
reuerendo
Junior Member
reuerendo began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2023
Device: PocketBook InkPad 4
Thank you. The book is marked as read in the library, but on the home page the progress bar does not reach 100%
Attached Thumbnails
Click image for larger version

Name:	scr0001.jpg
Views:	141
Size:	400.8 KB
ID:	204645  
reuerendo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sync KOReader progress with Boox Library Geremia Onyx Boox 1 11-14-2022 07:55 AM
Progress sync between koreader and ios Joretapo Kobo Reader 5 10-26-2020 08:21 PM
Looking for an offline method to sync book highlights/notes on KOReader kokaros Kindle Developer's Corner 6 03-25-2020 01:35 PM
How can I change KOReader password for Progress Sync? frittatahubris KOReader 6 02-09-2020 08:39 AM
Aura H2O KSM Wifi keeps turning off / Koreader progress sync tayseidel Kobo Developer's Corner 1 12-24-2015 09:27 PM


All times are GMT -4. The time now is 10:48 PM.


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