Struct ArtistFacts

Source
pub struct ArtistFacts {
Show 20 fields pub lookup_mbid: Option<String>, pub relationships_complete: bool, pub area: Option<String>, pub country_code: Option<String>, pub began: Option<String>, pub ended: Option<String>, pub active: Option<bool>, pub kind: Option<String>, pub disambiguation: Option<String>, pub genres: Vec<String>, pub aliases: Vec<String>, pub wikidata: Option<String>, pub discogs: Option<String>, pub homepage: Option<String>, pub summary: Option<Prose>, pub discography: Vec<KnownRelease>, pub discography_fetched_at: Option<u64>, pub members: Vec<Membership>, pub portrait: Option<Picture>, pub logo: Option<Picture>,
}
Expand description

What a source says about one artist.

Every field is optional: a source may not hold it, and an empty answer is not an error. None of these have a tag counterpart — there is no widely used tag for an artist’s country — so this is knowledge the files simply do not carry, rather than a second opinion about something they do.

Fields§

§lookup_mbid: Option<String>

An artist MBID whose exact lookup confirmed this canonical source ID.

Set by the lookup orchestrator when MusicBrainz redirects a merged ID. It preserves that verified alias without replacing the canonical ID in SourceRecord::source_id. Absent on legacy snapshots; name searches never establish this evidence.

§relationships_complete: bool

A full MusicBrainz lookup checked relationships, including a confirmed absence of URLs.

§area: Option<String>

Country or area of origin, as the source names it.

§country_code: Option<String>

The same country as a two-letter code, when the source gives one.

Kept beside the name rather than instead of it, because the source states both and they answer different needs: area is what a reader sees, the code is what they can type. It used to be read only as a fallback for a missing name and otherwise dropped — a fact the source had stated, thrown away because another field happened to be filled.

ISO 3166-1 alpha-2, so the United Kingdom is GB and not UK.

§began: Option<String>

Formation date: a year, or a fuller date when the source has one.

§ended: Option<String>

When it ended, for a group that has.

§active: Option<bool>

Whether it is still going, when the source says so.

Distinct from ArtistFacts::ended being absent, and the distinction is the whole point: a band with no end date may be one that never stopped, or one nobody has filled in. Some(true) is an answer, None is a silence, and a reader shown the same thing for both learns nothing.

§kind: Option<String>

person, group, orchestra, choir… as the source classifies it.

§disambiguation: Option<String>

The short phrase a source uses to tell two same-named artists apart — “US industrial metal band”, “UK folk singer”, and sometimes something as unhelpful as “the band”.

Not a description, and it must not be labelled as one: it exists to separate two entries that share a name, so it is written against whatever the other entry is. Shown as a note for that reason.

§genres: Vec<String>

Genres, as the source’s editors voted them, most agreed first.

Beside the genre tag rather than over it: what a crowd calls a record and what its tags call it are two answers, and the second is the one the user chose to write.

§aliases: Vec<String>

Other names the same artist is known by.

§wikidata: Option<String>

Wikidata entity page, when the source links to one.

The one link that leads somewhere else: Wikidata is how a real article is reached in the reader’s own language, so it is stored under its own name rather than lost in a list of URLs.

§discogs: Option<String>

Discogs page, when the source links to one.

§homepage: Option<String>

The artist’s own site, when they have one the source knows about.

§summary: Option<Prose>

A few sentences about the artist, with the attribution its licence requires — see Prose.

MusicBrainz never fills this: it holds identifiers and relationships, not prose. It comes from an encyclopaedia, and it is stored as one inseparable value for the reason written on the type.

§discography: Vec<KnownRelease>

Every record the source credits to this artist — see KnownRelease.

On the artist, and deliberately not on the releases. A release key is artist|title|folder, and an album you do not own has no folder, so a record you are missing cannot be an entity of this layer at all. It is instead a fact about the artist: “MusicBrainz credits fourteen albums to this name”.

Which of them are missing from the shelf is then derived on read, by comparing that list with the catalog — the same rule the whole layer follows for agreement with a tag. Storing “missing” would go stale the moment the album is bought, and the catalog would hold a claim it had stopped being able to justify.

§discography_fetched_at: Option<u64>

When a complete discography browse succeeded, including an empty answer.

Unix seconds, set only after every page was received and validated. Absent on older documents and artist lookups that never browsed release groups. A legacy nonempty list remains reusable without this optional field; an empty list needs it to distinguish an answer from no request. An artist lookup must preserve it only while the artist ID stays the same.

§members: Vec<Membership>

Who played in this band, or which bands this person played in — see Membership.

One list, not two, because MusicBrainz states one relation and the two readings are the same fact seen from either end. Splitting it here would mean deciding at write time which question a reader was going to ask, and getting it wrong for a person who is both — a soloist with a backing band under their own name is exactly that.

§portrait: Option<Picture>

A picture of the artist, when a source holds an address for one — see Picture.

The address, never the bytes. The image itself is written to disk — beside the music when one folder holds every album of theirs, an assets/ folder otherwise — and rediscovered from there, the same way cover.jpg is never registered anywhere either. What is kept here is only the fact that a source was asked and what it answered, so a later run does not ask again for nothing: see fetch --portraits.

The artist’s logo, when a source holds an address for one — see Picture.

Same shape and same reason as ArtistFacts::portrait: the address only, written to disk and rediscovered from there, kept here so a later run does not ask again for nothing: see fetch --logos.

Implementations§

Source§

impl ArtistFacts

Source

pub fn discography_is_cached(&self) -> bool

Whether a completed discography answer is cached, even when it is empty.

Nonempty legacy lists remain cached without a completion timestamp.

Source

pub fn line_up(&self) -> impl Iterator<Item = &Membership>

The line-up: everyone the source says played in this artist.

Source

pub fn bands(&self) -> impl Iterator<Item = &Membership>

The other way round: the bands this artist played in.

Source

pub fn line_up_in(&self, year: u32) -> (Vec<&Membership>, usize)

Who the source places in this band in a given year, and how many members it cannot place at all.

This is the whole reason the dates are worth fetching: a line-up is a fact about an artist, an album is a fact about a year, and crossing them answers the question a listener actually asks — who was in the band when this record came out.

Derived when read, never stored. A stored line-up would be a claim the catalog had stopped being able to justify the moment either side changed, and it is the same rule the missing-albums list already follows.

A row is placed only when the source’s own dates put it there: an undated membership, or one the source says has ended without saying when, is counted rather than shown. Including it would put a musician on a record they may not be on, which is the one mistake here that matters; dropping it in silence would be a filter the reader cannot see.

Trait Implementations§

Source§

impl Clone for ArtistFacts

Source§

fn clone(&self) -> ArtistFacts

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ArtistFacts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ArtistFacts

Source§

fn default() -> ArtistFacts

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ArtistFacts

Source§

fn eq(&self, other: &ArtistFacts) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ArtistFacts

Source§

impl StructuralPartialEq for ArtistFacts

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,