Discover unregistered KOReader books from history over wireless connections - #161
Open
TeGoOSS wants to merge 1 commit into
Open
Discover unregistered KOReader books from history over wireless connections#161TeGoOSS wants to merge 1 commit into
TeGoOSS wants to merge 1 commit into
Conversation
TeGoOSS
marked this pull request as ready for review
July 12, 2026 02:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-duplicatesthem against
device.books(), and matches UUIDs from the sidecar against theactive 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_APPconnections only and failsclosed 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
.addsdirectory. Those books donot 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 itsstatus, 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.