Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-25-2021, 11:10 PM   #646
de3sw2aq1
Junior Member
de3sw2aq1 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2013
Device: Kindle
I used to use KoboUtilities and KoboTouchExtended which let me get the current reading progress (% completion, finished) of each book into Calibre. I wanted to find a way to get similar info out of Plato.

I realized the Plato reading states and metadata are just JSON, so I'd normally just use jq. But the weird base10 vs base16 encoding of the id gave me trouble, and the reading states are in a separate file per book. I realized SQLite is powerful enough for this kind of query and works too though.

Maybe this is useful to someone else, thought I'd share it.

Code:
SELECT
    json_extract(metadata, "$.title") as title,
    json_extract(metadata, "$.author") as author,
    json_extract(metadata, "$.file.path") as path,
    json_extract(readingstate, "$.finished") as finished,
    json_extract(readingstate, "$.currentPage") as currentPage,
    json_extract(readingstate, "$.pagesCount") as pagesCount,
    CAST(
        json_extract(readingstate, "$.currentPage") AS FLOAT
    ) / json_extract(readingstate, "$.pagesCount") as progress
FROM (
        SELECT
            json(readfile(printf(".reading-states/%X.json", key))) as readingstate,
            value as metadata
        FROM json_each(readfile(".metadata.json"))
    )
WHERE
    readingstate IS NOT NULL
    AND finished = true; -- edit or remove this part to filter the query
de3sw2aq1 is offline   Reply With Quote
Old 01-29-2021, 03:08 PM   #647
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Plato 0.9.14

I've released 0.9.14.
baskerville is offline   Reply With Quote
Advert
Old 02-08-2021, 09:46 AM   #648
mrrooter
Junior Member
mrrooter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2021
Device: kobo forma
hey Baskerville, im new to eReaders and i just tried KOReader and Plato.
I love Plato: its sleek and has a nice clean UI. Thanks so much for it.

As i use my Kobo Forma to read Music sheet PDFs i dont need anything but pagewise browsing and fit-to-content zoom (i just spent the weekend manually cutting the margins on all my PDF music partitures by hand..)

The second does not seem to be implemented (or i didnt find). Fit to content width seems to to not much to my pdfs. I just want a maximum zoom to the area with content.
KOReader does this so i could be happier.. still:
Any chance of it coming anytime?

and i read you can set Plato to always start at boot?
if i had the fit-to-content i would not need anything else on the forma ever again
mrrooter is offline   Reply With Quote
Old 02-08-2021, 10:06 AM   #649
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by mrrooter View Post
As i use my Kobo Forma to read Music sheet PDFs i dont need anything but pagewise browsing and fit-to-content zoom (i just spent the weekend manually cutting the margins on all my PDF music partitures by hand..)

The second does not seem to be implemented (or i didnt find). Fit to content width seems to to not much to my pdfs. I just want a maximum zoom to the area with content.
Tap the crop icon in the toolbar. Once you have cropped the margins, select Zoom Mode → Fit to Width in the book menu.

Quote:
Originally Posted by mrrooter View Post
and i read you can set Plato to always start at boot?
Yes, but it might be problematic for the Forma.
baskerville is offline   Reply With Quote
Old 02-08-2021, 10:18 AM   #650
mrrooter
Junior Member
mrrooter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2021
Device: kobo forma
hey thanks for the quick response!

i can live with starting it everytime and most of the time it will only sleep i think.

as for the fit to content:
do i understand coorectly that i would choose a zoom level and it would stay static forever?

i need an automatic setting for all PDFs ever as each page in each document has a different margin.
i have about 150 scores (1-10 pages each).
also new documents come all the time.
When i wrote i cut my documents per hand i didnt mean with the same margin. i did it automatically with k2pdfopt but it took me all weekend to find the right tool (installed a bunch) and then the right settings in k2pdfopt. i would like no to have to do that preprocessing each time i get a new file.

so ideally it is handled per page automatically (the way it seems to be in koreader).
The kindle oasis also does it by default but the screen is too little. i am happy with the 7inch in Forma

Last edited by mrrooter; 02-08-2021 at 10:23 AM.
mrrooter is offline   Reply With Quote
Advert
Old 02-12-2021, 06:33 AM   #651
skalden
Junior Member
skalden began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2019
Device: Kobo H2O first edition
Quote:
Originally Posted by mrrooter View Post
i need an automatic setting for all PDFs ever as each page in each document
I do preprocessing with the desktop version from sejda.com (there is a free limited version).
You can crop all pages individually with auto-crop (didn't work always for me, don't know why). But doing it manually also works fast.
Perhaps you can give it a try?
skalden is offline   Reply With Quote
Old 02-16-2021, 04:32 AM   #652
mrrooter
Junior Member
mrrooter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2021
Device: kobo forma
hey thanks, i found a great solution with k2pdfopt.
It can crop pdfs in bulk for free. but i have to do it on a pc, so i cant do it while travelling etc.

ideally I would like the reader to do it automatically. it seems ill stick to KOreader, which does this.
mrrooter is offline   Reply With Quote
Old 02-16-2021, 06:14 AM   #653
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Plato 0.9.15

I've released 0.9.15.
baskerville is offline   Reply With Quote
Old 02-16-2021, 07:51 AM   #654
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by mrrooter View Post
i need an automatic setting for all PDFs ever as each page in each document has a different margin
Plato can't automatically crop margins yet.
baskerville is offline   Reply With Quote
Old 02-16-2021, 09:24 AM   #655
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
@baskerville

How can change the path for saving: .reading-states, .thumbnail-previews, .fat32-epoch and .metadata.json?

Purpose - I don't want them to be saved in the library ("/mnt/onboard/Books"), interferes a little.
Semwize is offline   Reply With Quote
Old 02-16-2021, 12:00 PM   #656
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by Semwize View Post
How can change the path for saving: .reading-states, .thumbnail-previews, .fat32-epoch and .metadata.json?
Purpose - I don't want them to be saved in the library ("/mnt/onboard/Books"), interferes a little.
What are the aforementioned files and directories interfering with?

Where would you like those files and directories to be saved to?
baskerville is offline   Reply With Quote
Old 02-16-2021, 12:59 PM   #657
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Synchronization. They are, of course, not difficult to add to exclusions, but the best option is to save them elsewhere, in the Plato folder itself (.adds/plato/name_folder)

If it's easy, of course. It's not a specific thing.
Semwize is offline   Reply With Quote
Old 02-17-2021, 09:30 AM   #658
skalden
Junior Member
skalden began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2019
Device: Kobo H2O first edition
zoom factor in Plato

As far as I know, I can only zoom to "fit-to-width" in landscape mode.
No other zoom factors are possible.
Is there a workaround for this?
Or is there a chance that a (customizable) zoom factor will be implemented?
skalden is offline   Reply With Quote
Old 02-18-2021, 08:50 AM   #659
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 443
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by Semwize View Post
the best option is to save them elsewhere, in the Plato folder itself (.adds/plato/name_folder)
Most of the library files could live in the installation directory. .metadata.json would require an additional hierarchy for the library paths. I'm not sure about .fat32-epoch.

However, I have installed Plato in /usr/local, and I often edit .metadata.json manually and invoke plato-import with the device plugged to a computer: I won't be able to do this if the library files aren't on the user partition.
baskerville is offline   Reply With Quote
Old 02-18-2021, 09:19 AM   #660
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by baskerville View Post
Most of the library files could live in the installation directory. .metadata.json would require an additional hierarchy for the library paths. I'm not sure about .fat32-epoch.
I probably don't understand somethingor didn't see, and how can I make it so that they are in .adds/plato/library, for example, and not in the catalog of books.

I just don't need extra files in mnt/onboard/Books ...
Semwize is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) chrox KOReader 566 04-19-2024 05:28 AM
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) hawhill Kindle Developer's Corner 1268 02-27-2024 11:49 AM
Kindle -- KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) hawhill KOReader 1219 01-27-2024 02:29 PM
v3 vs. v3+ as a pdf/DjVu reader hedonism_bot HanLin eBook 7 11-02-2010 08:16 PM


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


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