Module musicbrainz

Source
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.
LabelOfRelease
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 None and 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=json returns it.
artists
Artists, as /ws/2/artist/?query=…&fmt=json returns 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 None and 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=json returns it.
label_of_release
The label of a release, as a release lookup returns it.
labels
Labels, as /ws/2/label/?query=…&fmt=json returns them.
recording
One recording, as a lookup with RECORDING_INCLUDES returns it.
release
One release, as a lookup with RELEASE_INCLUDES answers.
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=json returns them.
valid_id
Admit an identifier as one URL path component; no name, query or external authority is accepted.