Skip to content

Discover unregistered KOReader books from history over wireless connections - #161

Open
TeGoOSS wants to merge 1 commit into
kyxap:developfrom
TeGoOSS:opds-sidecar-discovery
Open

Discover unregistered KOReader books from history over wireless connections#161
TeGoOSS wants to merge 1 commit into
kyxap:developfrom
TeGoOSS:opds-sidecar-discovery

Conversation

@TeGoOSS

@TeGoOSS TeGoOSS commented Jul 12, 2026

Copy link
Copy Markdown

Books downloaded through OPDS are not added to KOReader's Calibre wireless
inventory, so KOReader Sync cannot currently find their sidecars. This is
especially limiting when Calibre's Content Server is used to browse multiple
libraries remotely.

This PR adds an opt-in setting to discover recently opened, unregistered books
from KOReader's history.lua. It derives their sidecar paths, de-duplicates
them against device.books(), and matches UUIDs from the sidecar against the
active Calibre library. Numeric Calibre IDs are ignored because they can
collide between libraries.

History discovery is disabled by default and is import-only: discovered paths
are never used by Sync missing to KOReader or another device-write action.
It currently supports wireless SMART_DEVICE_APP connections only and fails
closed if the wireless inbox cannot be inferred unambiguously.

Wired discovery is not included. KOReader was installed on the test Kobo using
the documented Kobo installation method,
which placed its library beneath the hidden .adds directory. Those books do
not appear in Calibre's wired device inventory on this setup, so the plugin's
existing inventory-based wired path cannot discover them and we could not
faithfully develop or test an equivalent wired implementation. If wired
support is required and maintainers can point us toward a suitable test setup,
we would be happy to add it.

Tested with Calibre 9.11 on Windows 11 and KOReader on a Kobo Libra Colour. An
OPDS-downloaded book absent from device.books() was discovered and its
status, finish date, nine highlights, last-sync date, and raw sidecar were
imported successfully. Automated tests cover history discovery, path safety,
de-duplication, UUID matching, and exclusion from sidecar write-back.

@TeGoOSS
TeGoOSS marked this pull request as ready for review July 12, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant