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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2020, 04:13 PM   #1
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
[GUI Plugin] KOReader Sync

I recently started using KOReader on my Kobo and absolutely love it! The only thing I’m missing is the way in which the Kobo Utilities plugin pulled my read progress into calibre. So I decided to remedy that:

KOReader Sync is a calibre plugin to synchronize metadata from KOReader to calibre.

KOReader creates sidecar files that hold read progress and annotations. This plugin reads the data from those sidecar files and updates calibre's metadata based on them. It is inspired by the Kobo Utilities plugin, that synchronizes reading progress between the original Kobo firmware (“Nickel”) and custom columns in calibre.

Note that at the moment the sync is one-way—from the KOReader device to calibre—and only works for USB and wireless devices. For the latter, you'll need KOReader 2021.04 or newer.

Types of columns you can sync:
- A “Floating point numbers” column to store the current percent read, with “Format for numbers” set to {:.0%}.
- An “Integers” column to store the current percent read.
- A regular “Text” column to store the location you last stopped reading at.
- A “Rating” column to store your rating of the book, as entered on the book’s status page.
- A “Long text” column to store your review of the book, as entered on the book’s status page.
- A “Long text” column to store your bookmarks and highlights of the book, with “Interpret this column as” set to “Plain text formatted using markdown”. (Highlights are an unordered list with their metadata in an HTML comment.)
- A regular “Text” column to store the reading status of the book, as entered on the book status page (“Finished”, “Reading”, “On hold”).
- A “Date” column to store the date on which the book’s status was last modified. (This is probably the date on which you marked it as read.)
- A regular “Text” column to store the MD5 hash KOReader uses to sync progress to a KOReader Sync Server. (“Progress sync” in the KOReader app.) This might allow for syncing progress to calibre without having to connect your KOReader device, in the future.
- A “Long text” column to store the raw contents of the metadata sidecar, with “Interpret this column as” set to “Plain text”.

Download:
You can download the latest release from the attachment at the bottom of this post, or from sourcehut.

Issues:
If you encounter any issues with the plugin, please submit them here or in this forum thread.

Source:
The source code of this plugin can be found on sourcehut as well.

Version History
Spoiler:

0.2.3-alpha - 2021-11-23
  • Added
    • Enable `KOBOTOUCHEXTENDED`
0.2.2-alpha - 2021-06-22
  • Fixed
    • Skip metadata sidecars that cannot be decoded (e.g. from a very old version of KOReader)
  • Changed
    • Use `path` instead of `lpath` for book paths to go around `MTP_DEVICE` lowercasing the latter
    • Disable `MTP_DEVICE` because it cannot be supported (see #2)
  • Added
    • Enable `KINDLE2`
0.2.1-alpha - 2021-04-260.2.0-alpha: 2021-04-24
  • Added
    • Support for highlights and bookmarks
    • Counts to post-sync alerts
    • An .editorconfig and .pylintrc to define code layout
  • Changed
    • README.md to reflect current state of development

0.1.4-alpha: 2021-04-11
0.1.3-alpha: 2021-04-04
0.1.2-alpha: 2020-11-21
  • Added
    • Support for KOBO and KOBOTOUCH devices

0.1.1-alpha: 2020-11-18
  • Added
    • Support for all possible filetypes
    • Variables to easily enable a dry-run when debugging and remote debugging

0.1.0-alpha: 2020-11-18
  • Added
    • Everything needed for a first working version of the plugin
    • dummy_device and dummy_library for easy debugging
    • Makefile to build a plugin release as a ZIP file
    • TODO to keep to-dos in one place
    • environment.yml, in case anyone wants to recreate my Conda environment
    • This README.md



I’m very curious to hear what you think!
Attached Files
File Type: zip KOReader Sync v0.2.3-alpha.zip (64.1 KB, 779 views)

Last edited by harmtemolder; 11-23-2021 at 09:21 AM. Reason: Release v0.2.0-alpha
harmtemolder is offline   Reply With Quote
Old 11-20-2020, 06:15 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 11,526
Karma: 66680181
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Please consider attaching the plugin to your post as opposed to making people head elsewhere
PeterT is offline   Reply With Quote
Old 11-21-2020, 06:04 PM   #3
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Sorry about that, will add the latest ZIP right away
harmtemolder is offline   Reply With Quote
Old 11-21-2020, 06:31 PM   #4
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Release 0.1.2-alpha

I cannot seem to edit my original post, so I’ll attach the latest release of the plugin here. It should now support Kobo devices (tested on my Kobo Aura) as well as generic USB and folder devices.

EDIT: I crossed the threshold to be able to edit my original post, so added release 0.1.2-alpha there and removed it here.

Last edited by harmtemolder; 11-23-2020 at 06:22 AM.
harmtemolder is offline   Reply With Quote
Old 01-23-2021, 09:35 PM   #5
jd2733
Junior Member
jd2733 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2021
Device: Kobo Clara
Does annotation include highlights?

I’m most interested in getting highlights off of koreader. I was able to setup your plugin via usb, but don’t see mention of highlights in your documentation.

Thanks for working on it!
jd2733 is offline   Reply With Quote
Old 01-25-2021, 10:58 AM   #6
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by jd2733 View Post
I’m most interested in getting highlights off of koreader. I was able to setup your plugin via usb, but don’t see mention of highlights in your documentation.
Great to hear you were able to set it up. Unfortunately I haven’t gotten around to adding syncing of highlights. They are high on my wishlist as well, just haven’t had the time lately to work on the plugin.
harmtemolder is offline   Reply With Quote
Old 01-30-2021, 06:23 PM   #7
bitnerd
Junior Member
bitnerd began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2018
Device: many
Ooh, I'll be watching this closely. I would love to be able to do this over the network
bitnerd is offline   Reply With Quote
Old 02-09-2021, 06:14 PM   #8
twowheels
Wizard
twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.twowheels ought to be getting tired of karma fortunes by now.
 
twowheels's Avatar
 
Posts: 1,660
Karma: 10466716
Join Date: Nov 2010
Device: Kobo Clara HD, iPad Pro 10", iPhone SE 2020
EDIT: Found it, shortly after posting, ignore the rest. The assignment is indirect as the status flags are enumerated and then displayed as buttons on the book status page, within the book.



I was just exploring the source to see how hard it would be to fix something that's been bugging me and I saw the "abandoned" status flag, with the associated "On hold" text, which led me to a google search that brought me here.

I can't seem to figure out how to "abandon" a book. I have one book that I want to abandon for now (got bored with it), but the only option I see when holding down on the book is "Mark as read", "Add to favorites", etc, but nothing to "abandon" it or put it on hold. That said, your plugin description above says that it only syncs from device to Calbire, so it must be something that can be set on the device, yet I can only find comparisons against the value, nothing that sets the value in the source making me think that it's an incomplete feature or one that has only been partially removed.

Last edited by twowheels; 02-09-2021 at 06:18 PM.
twowheels is offline   Reply With Quote
Old 04-04-2021, 09:11 PM   #9
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
I just uploaded v0.1.3-alpha which now supports KOReader's wireless connnection, but that will not work until this pull request is part of your KOReader app.
harmtemolder is offline   Reply With Quote
Old 04-24-2021, 06:03 PM   #10
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by bitnerd View Post
Ooh, I'll be watching this closely. I would love to be able to do this over the network
Since the most recent release of KOReader this works. Enjoy
harmtemolder is offline   Reply With Quote
Old 04-24-2021, 06:04 PM   #11
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by jd2733 View Post
I’m most interested in getting highlights off of koreader.
I’ve added support for highlights. Let me know what you think
harmtemolder is offline   Reply With Quote
Old 05-12-2021, 10:42 PM   #12
SpaceGun
Junior Member
SpaceGun began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura H2O
Hello! I'm using 0.2.0 with calibre 5.17 (installed from calibre's "Get new plugins" menu). When I attempt the "Sync from KOreader" option I get the following error:

Quote:
calibre, version 5.17.0
ERROR: Unhandled exception: <b>UnicodeDecodeError</b>:'utf-8' codec can't decode byte 0x97 in position 10: invalid start byte

calibre 5.17 embedded-python: True is64bit: True
Linux-5.4.0-71-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.4.0-71-generic', '#79-Ubuntu SMP Wed Mar 24 10:56:57 UTC 2021')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Annotations (1, 15, 0) && KOReader Sync (0, 2, 0) && Kobo Utilities (2, 13, 1)
Traceback (most recent call last):
File "calibre_plugins.koreader.action", line 327, in sync_to_calibre
sidecar_contents = self.get_sidecar(device, sidecar_path)
File "calibre_plugins.koreader.action", line 217, in get_sidecar
parsed_contents = self.parse_sidecar_lua(contents.decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x97 in position 10: invalid start byte
The error persisted while using version 0.2.1 from the sourcehut, along a very similar one when I tried it (0.2.1) from a Windows partition. Any leads would be much appreciated!
SpaceGun is offline   Reply With Quote
Old 05-19-2021, 05:17 PM   #13
harmtemolder
Member
harmtemolder began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
I’ve sent you a PM to get to the bottom of this
harmtemolder is offline   Reply With Quote
Old 05-23-2021, 08:58 PM   #14
bitnerd
Junior Member
bitnerd began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2018
Device: many
Seems to work quite well wirelessly on Calibre 5.18 with plugin 0.2.0

The modified date wasn't coming across but I may have a typo so I'll keep messing with it
bitnerd is offline   Reply With Quote
Old 05-27-2021, 05:27 PM   #15
SpaceGun
Junior Member
SpaceGun began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura H2O
harmtemolder has very kindly sorted out the issue I was having. All the features I've tried (bookmarks, percent read, reading status) are syncing correctly. Thanks!
SpaceGun is offline   Reply With Quote
Reply

Tags
calibre, koreader

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Goodreads Sync kiwidude Plugins 1550 11-23-2021 01:30 AM
[GUI Plugin] Skoob Sync thiago.eec Plugins 15 10-29-2021 10:54 AM
[GUI Plugin] BookFusion Cloud Sync skillachie Plugins 33 08-14-2021 12:54 AM
[GUI Plugin] KyBook3 Sync - replaced karl1c Plugins 45 04-23-2021 07:33 PM
[Gui Plugin] Cloud Sync kerimlcr Plugins 13 03-06-2018 06:13 AM


All times are GMT -4. The time now is 04:26 AM.


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