Module fanarttv

Source
Expand description

Fanart.tv music artwork: artist portraits, logos, banners and backgrounds, album covers and disc art, plus record-label logos.

Deliberately no network, like crate::acoustid and crate::musicbrainz: this module builds the address to ask and reads the answer somebody else fetched.

crate::wikipedia::portrait_file is asked before this for a portrait — a Commons image is reached through the identifier MusicBrainz already gave, and Commons hosts nothing whose licence is not stated. Fanart.tv is user-submitted: fetch --portraits uses it only where Wikidata has nothing, and the record it leaves says which service actually answered, so a reader who cares about that distinction can tell — see SOURCE.

A logo has no such alternative to try first: Wikidata states no logo claim for an artist, so fetch --logos asks Fanart.tv directly, under its own record name — see LOGO_SOURCE. A banner rides the very same request: fetch --logos --banners reads banner_url out of the answer already fetched for the logo, rather than asking twice for one artist.

Unlike AcoustID, which is shown a fingerprint and has to guess which recording it is, Fanart.tv is asked about an artist by MusicBrainz identifier — the same one every artist record in sources.json already carries. There is nothing to score and nothing to arbitrate: the answer is either this artist’s images or none.

Structs§

AlbumArtwork
Fanart.tv artwork belonging to one MusicBrainz release group.

Constants§

ALBUM_COVER_SOURCE
The completion record for Fanart.tv album covers.
ARTWORK_SOURCE
The legacy record left after the complete Fanart.tv artwork pass inspected an artist or album before artwork families became independently selectable. Kept so those completed passes are not needlessly repeated.
BACKGROUND_SOURCE
The completion record for Fanart.tv artist backgrounds.
BANNER_SOURCE
The completion record for Fanart.tv artist banners.
CDART_SOURCE
The completion record for Fanart.tv disc artwork.
KEY_VARIABLE
The environment variable holding the application key.
LABEL_LOGO_SOURCE
The separate source record for a record label’s logo.
LOGO_SOURCE
The name a logo is stored under — not SOURCE, though the same request answers both.
PORTRAIT_ARTWORK_SOURCE
The completion record for Fanart.tv artist portraits.
REQUEST_INTERVAL
How long to wait between requests.
SOURCE
The name records from this service carry in sources.json.
WEB_SERVICE
Base address of the service.

Functions§

album_artwork
Reads the album artwork embedded in an artist response from API v3.2.
artist_response
Refuses a response whose identity does not match the artist requested.
background_url
The best artist background, preferring the native 4K pool.
banner_url
The artist’s banner address to download, or None when the service has none.
key
The key this machine holds, when it holds one.
label_logo_url
The record label’s logo address, or None when it has none.
label_lookup_url
Where to ask about one record label, by its MusicBrainz label identifier.
label_response
Refuses a response whose identity does not match the label requested.
logo_url
The artist’s logo address to download, or None when the service has none.
lookup_url
Where to ask about one artist.
no_key
What to tell somebody who has no application key.
portrait_url
The image address to download, or None when the service has nothing.