Module sources

Source
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§

ArtistFacts
What a source says about one artist.
Attachment
How many records the catalog can place, and how many are waiting.
CreditExclusion
A reversible choice about one credit relationship, not its parent record.
CreditLink
One artist relationship asserted by MusicBrainz.
KnownRelease
One record a source credits to an artist, whether or not you own it.
LabelFacts
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.
ReleaseFacts
What a source says about one release.
ReviewItem
One reviewable claim as presented by the quality-resolution workflow.
SourceRecord
One entity, as one source describes it.
SourceReview
One durable review decision, bound to the exact claim that was reviewed.
SourcedCreditLink
A rich external credit placed on a local recording or one of its works.
SourcedEditionCreditLink
A credit asserted about one precise edition, not every recording on it.
SourcedLabelIdentity
A MusicBrainz identity evidence record placed on its local label.
SourcedMembershipLink
A dated artist-to-artist membership placed beside the canonical catalog.
SourcedWork
One externally described composition, grouped without losing its evidence.
SourcedWorkLink
A work relationship placed on a local recording, while retaining its source.
SourcedWorkParentLink
A sourced child → parent work assertion attached to a local recording.
Sources
Everything other sources have said, as it sits in sources.json.
TrackFacts
What a source says about one recorded performance.
WorkLink
One work relationship asserted by a source about a recording.
WorkParentLink
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.
LabelIdentityResolution
Reconciliation of a label’s tag identity with MusicBrainz evidence.
MusicBrainzReleaseIdentity
The MusicBrainz entity actually named by an album source snapshot.
ReviewDecision
A user’s explicit decision about one external identity claim.
ReviewReason
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.json document 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_json wrote.
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.json sits 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.