Expand description
What other sources say about the library.
The catalog holds what the files say. crate::user holds what the user
says. This holds what somebody else says — MusicBrainz first, a plugin
later — and it is a third store rather than a column in either of the other
two, for reasons written out in docs/design/attribution.md.
The rule the whole module exists to enforce: a fetched value sits beside
the tag, never on top of it. Writing a fetched genre into the catalog’s
genre would cost three things at once — saying where the value came from,
noticing that the source and the tag differ, and undoing it — and it would
not even survive, because a scan rebuilds the catalog from the files.
Nothing here touches the network. This is the receptacle; filling it from MusicBrainz is a later step, and the layer is testable without a single request.
Structs§
- Artist
Facts - What a source says about one artist.
- Attachment
- How many records the catalog can place, and how many are waiting.
- Credit
Exclusion - A reversible choice about one credit relationship, not its parent record.
- Credit
Link - One artist relationship asserted by MusicBrainz.
- Known
Release - One record a source credits to an artist, whether or not you own it.
- Label
Facts - What external sources say about a label already known by name.
- Membership
- One spell in a band, as a source dates it.
- Picture
- A picture of an artist, as a source answered it.
- Prose
- A piece of prose taken from somewhere, with what its licence obliges.
- Release
Facts - What a source says about one release.
- Review
Item - One reviewable claim as presented by the quality-resolution workflow.
- Source
Record - One entity, as one source describes it.
- Source
Review - One durable review decision, bound to the exact claim that was reviewed.
- Sourced
Credit Link - A rich external credit placed on a local recording or one of its works.
- Sourced
Edition Credit Link - A credit asserted about one precise edition, not every recording on it.
- Sourced
Label Identity - A MusicBrainz identity evidence record placed on its local label.
- Sourced
Membership Link - A dated artist-to-artist membership placed beside the canonical catalog.
- Sourced
Work - One externally described composition, grouped without losing its evidence.
- Sourced
Work Link - A work relationship placed on a local recording, while retaining its source.
- Sourced
Work Parent Link - A sourced child → parent work assertion attached to a local recording.
- Sources
- Everything other sources have said, as it sits in
sources.json. - Track
Facts - What a source says about one recorded performance.
- Work
Link - One work relationship asserted by a source about a recording.
- Work
Parent Link - One source-asserted part-of-work relationship, directed child → parent.
Enums§
- Confidence
- How the record was attached to the entity it describes.
- Facts
- What a source says, for one kind of entity.
- Label
Identity Resolution - Reconciliation of a label’s tag identity with MusicBrainz evidence.
- Music
Brainz Release Identity - The MusicBrainz entity actually named by an album source snapshot.
- Review
Decision - A user’s explicit decision about one external identity claim.
- Review
Reason - Why a current source record needs a human decision.
- Side
- Which end of a membership the named artist is.
- Verdict
- What a source’s value amounts to, next to the tag it can be compared with.
Constants§
- MUSICBRAINZ
- The source name MusicBrainz records carry.
- SOURCES_
FILE - Name of the file, inside the data folder that holds the catalog.
- SOURCES_
FORMAT_ VERSION - Version of the
sources.jsondocument this build writes. Version 1 is accepted as the review-free predecessor and migrated on the next save.
Functions§
- attachment
- Counts what this catalog can currently place.
- from_
json - Reads back what
to_jsonwrote. - load
- Reads the layer;
Ok(None)when nothing has ever been fetched. - load_
all - Read every stored claim, including Discogs profiles awaiting revalidation. Only use this for a read/modify/write operation or a backup, not display.
- save
- Writes the layer, atomically and pretty.
- sources_
path - Where
sources.jsonsits inside a data folder. - to_json
- The document: a version, and one array of records.
- verdict
- Compares what a source says with what the tags say.
- verdict_
date - Compares two dates written at different precisions.
- verdict_
set - The verdict for a field that holds a set, not a value: genres.