Repository navigation
feat: add optional Hardcover book metadata provider - #294
Open
TyceHerrman wants to merge 3 commits into
Open
TyceHerrman wants to merge 3 commits into
TyceHerrman wants to merge 3 commits into
Conversation
TyceHerrman
marked this pull request as ready for review
October 15, 2026 22:51
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.
Adds Hardcover as an optional book provider, addressing #272. Users connect in their browser with authorization-code OAuth and S256 PKCE, then search by title or import by numeric book ID through the existing Media DB workflow.
OAuth requests only
read:catalog. The callback validates state, issuer, client identity, expiration, and one-time use. Access and rotating refresh credentials are stored in Obsidian SecretStorage, with concurrent refreshes coordinated. Canceling sign-in or editing the client ID preserves completed token rotations; older refreshes cannot overwrite a newly authorized connection. Disconnect waits for an active refresh, revokes its current credentials, and then clears the connection. No manual token or client secret is used.Imports include title, authors, publication year, description, genres, cover, average rating, pages, and ISBNs. Edition fields use the default physical edition, falling back to the default ebook edition. Searches are capped at 20 results and preserve ranking; requests are spaced to respect the per-minute quota. Hardcover is disabled by default.
Validation:
bun run typecheck,bun run lint, andbun run testpassed: all 61 tests (14 provider tests and 16 OAuth tests). Seven OAuth regression tests cover cancellation and new sign-in during refresh, client edits, replacement connections, disconnect during refresh or authorization, and retrying failed revocation with rotated credentials.bun run buildpassed.git diff --cached --checkpassed before commit.Live validation (Obsidian, 2026-10-15; isolated vault, source commit
8046b5a):Media DB/books/The Left Hand of Darkness (1969).md.All test notes/settings were confined to the isolated vault. No live OAuth credentials remain in that vault.
Deployment: the OAuth public client ID is configurable for development. A production registration should be owned by the project maintainer; the contributor's test client ID is not included in source. Register
obsidian://media-db-hardcover, allow onlyread:catalog, and leave Device Authorization Grant disabled.AI assistance: implementation, tests, and this description were prepared with AI. results and pr reviewed and edited by me.
Closes #272