feat(metadata): multi-provider abstraction (LoC, DNB, K10plus, Open Library)#128
Merged
phildenhoff merged 2 commits intoJun 14, 2026
Merged
Conversation
…ibrary) 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>
Contributor
…-library-metadata-provider # Conflicts: # src/components/organisms/AddBook.tsx
libcalibre Test Coverage ReportOverall coverage: 80.81% Coverage breakdown available in the artifacts. |
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.
Summary
Makes Hardcover one metadata source among several. With no Hardcover key configured, ISBN lookup still works via the keyless library providers.
Live providers: Library of Congress, Deutsche Nationalbibliothek, K10plus (SRU/MARC21), Open Library (JSON), and Hardcover (GraphQL). All five lookups verified end-to-end against the real endpoints.
Backend (
src-tauri/src/metadata/)BookMetadatamodel + three provider-agnostic Tauri commands behind enum dispatch (Tauri/specta-safe;providercrosses as a string).quick-xmlMARCXML parser: author inversion ("Last, First" → display order, corporate names left alone),6xxsubjects,008/041language, entity decoding (&), and ISBN-match verification.Frontend
MetadataSearchModalwith source provenance and a designed cover-less placeholder.Settings migration
Flat
hardcoverApiKey/hardcoverAutoLookup→ a provider block. Versioned:v0→v1folds the Hardcover key in;v1→v2adds K10plus. Keyless libraries default on; existing Hardcover keys preserved.Also fixes
Testing
format:check,bun lint(web + clippy),tscall clean.Fixes CDL-7
🤖 Generated with Claude Code