Expand description
Reading what MusicBrainz answers, and deciding whether it is about us.
Deliberately no network. This module turns a response that somebody
else fetched into crate::sources records, and decides how firmly one of
them is attached to an entity of the catalog. Those two jobs are where the
mistakes live — a misread field, a wrong album picked confidently — and
neither of them has any reason to need a socket to be tested.
The field spellings come from the MusicBrainz documentation and are quoted
exactly: sort-name, life-span.begin, primary-type, secondary-types,
first-release-date, label-info[].label.name. Hyphens, not underscores —
guessing one of those wrong produces a record that is silently empty.
Structs§
- Candidate
- One answer among the several a search returns.
- Label
OfRelease - A label credited on a release: its name and, when the same entry carried one, its MusicBrainz identifier.
Enums§
- NoMatch
- Why nothing was attached, which is worth saying rather than returning
Noneand letting the caller invent a reason.
Constants§
- ARTIST_
INCLUDES - What to ask for alongside an artist, in one request.
- BROWSE_
LIMIT - How many release groups one browse request may return.
- LABEL_
INCLUDES - URL relationships include the Wikidata link used by label summaries.
- RECORDING_
INCLUDES - What a recording lookup needs for performance, production and composition credits in a single request.
- RELEASE_
INCLUDES - What to ask for alongside a release, in one request.
- REQUEST_
INTERVAL - The gap the service requires between two requests, with a small margin.
- WEB_
SERVICE - Base address of the web service, kept here so the client has nothing to decide.
Functions§
- artist
- One artist, as
/ws/2/artist/{mbid}?fmt=jsonreturns it. - artists
- Artists, as
/ws/2/artist/?query=…&fmt=jsonreturns them. - best_
match - Picks the answer that describes the thing asked about, or says why none does.
- discography
- One page of an artist’s discography, and how many there are in all.
- discography_
page - Read a complete browse page without confusing missing data with an empty
discography. Network callers must reject
Noneand keep their prior answer. - discography_
url - Where to ask for everything credited to an artist.
- escape_
query - Escapes the characters Lucene reads as syntax.
- label
- One label, as
/ws/2/label/{mbid}?fmt=jsonreturns it. - label_
of_ release - The label of a release, as a release lookup returns it.
- labels
- Labels, as
/ws/2/label/?query=…&fmt=jsonreturns them. - recording
- One recording, as a lookup with
RECORDING_INCLUDESreturns it. - release
- One release, as a lookup with
RELEASE_INCLUDESanswers. - release_
group - One release group, as a lookup answers:
/ws/2/release-group/<mbid>. - release_
groups - Release groups, as
/ws/2/release-group/?query=…&fmt=jsonreturns them. - valid_
id - Admit an identifier as one URL path component; no name, query or external authority is accepted.