harmtemolder / koreader-calibre-plugin

A calibre plugin to synchronize metadata from KOReader to calibre
GNU General Public License v3.0
46 stars 5 forks source link

KOReader calibre plugin

Hi,

I'm looking for someone who wants to help me maintain this plugin, because I don't use it all that much anymore. Please contact me if you're up for this.

Harm

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 primarily 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.

Pushing metadata from calibre to KOReader currently works only for books which do not have KOReader sidecar files, and of course requires the raw metadata column to be mapped. The use-case is for setting up a new device, or if a book was removed from your device and you've now added it back. This has been tested for calibre's Connect to Folder and Custom USB Device modes. It does not seem to work for the Kobo Touch device driver nor with wireless connections, but I (@charlesangus) find those don't communicate perfectly with Calibre/KOReader in any case... I haven't disabled it for other devices - it may be a quirk in my setup which is causing it to fail, and it may work fine for you.

Releases will also be uploaded to this plugin thread on the MobileRead Forums. If you are on there as well, please let me know what you think of the plugin in that thread.

Using this plugin

Download and install

  1. Go to your calibre's Preferences > Plugins > Get new plugins and search for KOReader Sync
  2. Click Install
  3. Restart calibre

Alternatively

  1. Download the latest release from here.
  2. Go to your calibre's Preferences > Plugins > Load plugin from file and point it to the downloaded ZIP file
  3. Restart calibre

Setup

  1. Pick and choose the metadata you would like to sync and create the appropriate columns in calibre. These are your options:
    • 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 regular Text column to store the reading status of the book, as entered on the book status page (Finished, Reading, On hold).
    • A Yes/No column to store the reading status of the book, as a boolean (Yes = Finished, No = everything else).
    • A Date column to store the date on which the first highlight or bookmark was made. (This is probably around the time you started reading.)
    • A Date column to store the date on which the last highlight or bookmark was made. (This is probably around the time you finished reading.)
    • 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 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 Date column to store when the last sync was performed.
    • A Date column to store when the sidecar file was last modified.',
    • A Long text column to store the contents of the metadata sidecar as JSON, with Interpret this column as set to Plain text. This is required to sync metadata back to KOReader sidecars.
  2. Add KOReader Sync to main toolbar when a device is connected, if it isn't there already.
  3. Right-click the KOReader Sync icon and Configure.
  4. Map the metadata you want to sync to the newly created calibre columns.
  5. Click OK to save your mapping.
  6. From now on just click the KOReader Sync icon to sync all mapped metadata for all books on the connected device to calibre.

Things to consider

Supported devices

This plugin has been tested successfully with:

This plugin is not compatible with:

Issues

If you encounter any issues with the plugin, please submit them here.

Acknowledgements

Contributing to this plugin

Notes & Tips

Testing in calibre

Use make to load the plugin into calibre and launch it:

make dev

Alternatively, build a release and load that:

make zip load

Building a release

Make sure you have the dependencies and have set the correct version number in __init__.py, pluginIndexKOReaderSync.txt and Makefile. Also update Changelog. Then:

make zip

Debugging a release

  1. Download the required release from here
  2. Add it to calibre by running this in your terminal: calibre-customize -a "KOReader Sync vX.X.X-alpha.zip", where X.X.X refers to the version you downloaded
  3. Start calibre in debug mode with calibre-debug -g
  4. Configure the KOReader plugin as described here
  5. Connect your device
  6. Run the sync by clicking the KOReader icon in your toolbar
  7. Check the details of the message when it's done if any/all books have been synced correctly
  8. Check your (custom) columns for one of those books to see if their contents are what they should be
  9. Check the output in your terminal for lines containing koreader to see what it did

Changelog

All notable changes to this project will be documented here.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

Changed

0.5.2-beta - 2023-05-22

Added

Changed

Fixed

0.5.1-beta - 2022-12-27

Added

Changed

Fixed

0.5.0-beta - 2022-12-27

Added

Changed

0.4.1-beta - 2022-11-08

Changed

0.4.0-beta - 2022-11-02

Added

0.3.2-beta - 2022-09-16

Added

0.3.1-beta - 2022-09-15

Added

0.3.0-beta - 2022-09-13

Changed

0.2.7-alpha - 2022-02-18

Added

0.2.6-alpha - 2022-02-04

Added

0.2.5-alpha - 2021-12-20

Added

0.2.4-alpha - 2021-12-12

Added

0.2.3-alpha - 2021-11-23

Added

0.2.2-alpha - 2021-06-22

Fixed

Changed

Added

0.2.1-alpha - 2021-04-26

Added

0.2.0-alpha - 2021-04-24

Added

Changed

0.1.4-alpha - 2021-04-11

Fixed

0.1.3-alpha - 2021-04-04

Added

0.1.2-alpha - 2020-11-21

Added

0.1.1-alpha - 2020-11-18

Added

0.1.0-alpha - 2020-11-18

Added