pub struct KnownRelease {
pub mbid: String,
pub title: String,
pub first_released: Option<String>,
pub primary_type: Option<String>,
pub secondary_types: Vec<String>,
}Expand description
One record a source credits to an artist, whether or not you own it.
Enough to recognise it and to show it: the identifier that makes a second
fetch an update, the title, when it first appeared, and what kind of record
it is. Not a ReleaseFacts, which is what a source says about an album
in the catalog — this is a name on a list, and the difference matters:
one is attached to files, the other is precisely the one that is not.
Fields§
§mbid: StringRelease-group identifier, which is what the catalog’s own
release_group_mbid can be compared against without guessing.
title: StringTitle as the source spells it.
first_released: Option<String>When the album first appeared — the year a reader recognises it by.
primary_type: Option<String>Album, Single, EP, Broadcast, Other.
secondary_types: Vec<String>Compilation, Soundtrack, Live, Remix, Demo…
Implementations§
Source§impl KnownRelease
impl KnownRelease
Sourcepub fn is_studio_album(&self) -> bool
pub fn is_studio_album(&self) -> bool
true for a studio album: primary type Album, and nothing else.
The filter that makes a completeness report readable rather than a wall. A discography holds every single, every live recording, every compilation somebody assembled, and reporting all of them as missing would be true and useless — nobody’s shelf holds every single ever pressed, and a report that is mostly noise is a report nobody opens.
Applied here, on what came back, rather than trusted to the request: a server-side filter narrows what travels, but only this decides what is shown, so a parameter the service ignores costs bandwidth and not correctness.
Sourcepub fn stated_type(&self) -> String
pub fn stated_type(&self) -> String
What the source calls this record, in the source’s own words.
For a report that has left something out to be able to say why. The
words are MusicBrainz’s — Album · Live, Single, Album · Compilation
— rather than a vocabulary of our own, because the reader’s next move is
often to go and correct the type on the page where it is set, and a
paraphrase would send them looking for a word that is not written there.
A record nobody has typed at all says so: it is not a studio album either, and having no type is exactly why it was left out.
Trait Implementations§
Source§impl Clone for KnownRelease
impl Clone for KnownRelease
Source§fn clone(&self) -> KnownRelease
fn clone(&self) -> KnownRelease
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more