Repository navigation
feat(locallibrary): add a discogs plugin for covers and track details - #598
Open
botandbang wants to merge 3 commits into
Open
botandbang wants to merge 3 commits into
botandbang wants to merge 3 commits into
Conversation
Adds plugins/discogs, with covers and tags providers that search Discogs' database by an album's label, then its name, else a track's title, keep within Discogs' rate limit, and say how to sign in when there's no account. Adds plugins/accounts/discogs-account, a keys account type for a Discogs personal access token, scoped to database searches. Registers both with locallibrary, documents them, and updates the provider listings the CLI and player tests expect.
…lugin # Conflicts: # apps/locallibrary/Cargo.toml
SizeCompared with main. KiB are 1,024 bytes.
|
bnb
approved these changes
Nov 12, 2026
Rust coverageFrom run 840. Both are held to the thresholds in .cargo/config.toml.
|
…'s floor and package count No conflicts. The coverage check fails a crate with no floor, so plugins/discogs gets one just under what CI measured (98.32% lines, 96.30% functions, 98.01% regions). The CLI links 582 packages with the plugin, one more than main's 581: the plugin crate is the only package cargo tree lists that main doesn't. cargo-shear can't see the plugins used (build.rs links them), so discogs joins the others on its ignored list.
This branch has not been deployed
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.
What and why
Fixes LOC-100. Replaces the plan in #227.
Adds two plugins on the providers hook, modelled on coverart:
plugins/discogs:discogs.covers(artwork) anddiscogs.tags(metadata), forlocallibrary art fetch --from discogs.coversandlocallibrary track fetch --from discogs.tags.Bicep, Ninja Tune ZEN242, 2016, so the catalogue number shows (neither a track nor its tags have a field for it).Warp (2)read asWarp, "Not On Label" skipped) and the first style, else genre.Retry-Aftersays (a minute without one) and tries up to three times; a wait over two minutes leaves the album out with a warning.X-Discogs-Ratelimit-Remaining: 0holds the next search for the rest of the minute.library:read(for a track's label),net:api.discogs.com(one request a second at most) andnet:i.discogs.com. Requests carrylocallibrary/<version> (+https://github.com/cutenode/localnetwork)as their contact.plugins/accounts/discogs-account: akeysaccount type for a personal access token from discogs.com/settings/developers, sent asDiscogs token={token}, whoami at/oauth/identity, with one scope covering onlyGET https://api.discogs.com/database/search*. Images are fetched without the account.Also: both plugins are in apps/locallibrary/docs/plugins.md, how-it-works.md, editing.md and the plugin diagram, each crate has a README, and the CLI and player tests that list providers now list Discogs's too.
How it was tested
cargo nextest run -p locallibrary-cli: 1278 passed, including the shipped-manifest checks that validate both new manifests.cargo clippy --all-targets -- -D warningson both crates and the CLI,cargo fmt --check.Not checked against the live API: Discogs' developer pages refused automated reads, so the response shapes follow the go-discogs client's types. Discogs' terms on downloading and keeping images (support.discogs.com/hc/en-us/articles/360009334593), which #227 asked about, need reading before merge.
New app or plugin
Diagrams
diagrams-checked: apps/locallibrary/README.md: discogs links only crates the diagram already draws.
diagrams-checked: apps/locallibrary/docs/diagrams/accounts.md: a keys account behaves as the diagram's note says.
Checklist
apps/locallibrary/changes/discogs-plugin.mdhas a changelog linedocs/and--helpstill say what the code doesBudgets
budget-raise: deps/locallibrary-cli: the discogs plugin crate is the one package the CLI links that main does not (581 to 582)