harmtemolder / koreader-calibre-plugin

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

KOReader calibre plugin

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 best experience please use the latest KOReader release

Releases will also be uploaded to 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 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. Works for wired connection only, wireless will be always empty,
    • A Long text column to store the contents of the metadata sidecar as HTML, with Interpret this column as set to HTML.
  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.

Note: Some field are depreciated and removed from plugin since they are changed/removed from sidecar_contents data structure:

Things to consider

Supported devices

This plugin has been tested successfully with:

This plugin is not compatible with (may work with latest plugin release):

Star History

Star History Chart

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

Release

  1. Update version in one file version.txt
  2. Use make release and it will update version, create zip, upload zip to plugin directory
  3. Push all changes
  4. Use make tag to create and push tag
  5. Create release in github, use pushed tag and upload created zip to the release

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