Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2021, 12:10 AM   #646
de3sw2aq1
Junior Member
de3sw2aq1 began at the beginning.
 
Posts: 1
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, 04:08 PM   #647
baskerville
Addict
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: 330
Karma: 304864
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, 10: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, 11:06 AM   #649
baskerville
Addict
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: 330
Karma: 304864
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, 11: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 11:23 AM.
mrrooter is offline   Reply With Quote
Advert
Old 02-12-2021, 07: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, 05: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, 07:14 AM   #653
baskerville
Addict
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: 330
Karma: 304864
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, 08:51 AM   #654
baskerville
Addict
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: 330
Karma: 304864
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, 10:24 AM   #655
Semwize
 
Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.
 
Posts: 538
Karma: 188188
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, 01:00 PM   #656
baskerville
Addict
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: 330
Karma: 304864
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, 01:59 PM   #657
Semwize
 
Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.
 
Posts: 538
Karma: 188188
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, 10: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, 09:50 AM   #659
baskerville
Addict
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: 330
Karma: 304864
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, 10:19 AM   #660
Semwize
 
Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.Semwize can program the VCR without an owner's manual.
 
Posts: 538
Karma: 188188
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle -- KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) hawhill KOReader 1082 02-24-2021 11:21 AM
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) hawhill Kindle Developer's Corner 1161 02-17-2021 06:28 PM
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) chrox KOReader 381 01-18-2021 04:19 PM
v3 vs. v3+ as a pdf/DjVu reader hedonism_bot HanLin eBook 7 11-02-2010 09:16 PM


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


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