Skip to content

Commit c212a96

Browse files
phildenhoffclaude
andauthored
feat(metadata): multi-provider abstraction (LoC, DNB, K10plus, Open Library) (#128)
Make Hardcover one metadata source among several. With no Hardcover key configured, ISBN lookup still works via the keyless library providers. Backend (src-tauri/src/metadata/): a unified BookMetadata model and three provider-agnostic Tauri commands behind enum dispatch. A config-driven SRU endpoint registry powers Library of Congress, Deutsche Nationalbibliothek and K10plus (MARC21/slim via a quick-xml parser: author inversion, 6xx subjects, 008/041 language, entity decoding, ISBN-match verification). Open Library is a keyless JSON provider; Hardcover (GraphQL) moves in unchanged in behaviour. ISBN 10<->13 equivalence lives here as the single authority. Frontend: a capability-driven provider registry + a streaming aggregator that dedupes by ISBN to one whole record (with cover backfill as the only borrowed field) and pins the file's ISBN match. One unified MetadataSearchModal with source provenance and a designed cover-less placeholder; provider-agnostic hooks for the edit and import flows; a "Metadata sources" settings pane; and library subjects offered as opt-in tag-suggestion chips. Language is parsed but applied later (CDL-2). Settings migrate from the flat hardcoverApiKey/hardcoverAutoLookup keys to a provider block (v0->v1, then v1->v2 adds K10plus), with the keyless libraries enabled by default and existing Hardcover keys preserved. Also fixes: - Edit Book showing a stale cover after a lookup: cache-bust the single-book cover URL by mtime (the list paths stay stat-free at scale). - Settings panel content shifting sideways when a scrollbar appears. - Provider-row switch alignment; Add Book modal label truncation. - "Matches ISBN" picker badge contrast in light and dark. Fixes CDL-7 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a8435cc commit c212a96

48 files changed

Lines changed: 4002 additions & 2198 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ epub = "2.1.1"
2121
mobi = "0.8.0"
2222
libcalibre = { path = "../crates/libcalibre" }
2323
log = "0.4"
24+
quick-xml = "0.38"
2425
regex = "1.10.2"
2526
reqwest = { version = "0.12", features = ["json"] }
2627
serde = { version = "1.0", features = ["derive"] }

0 commit comments

Comments
 (0)