Documentation ¶
Overview ¶
Package internal defines internal types and functions for online sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetArtistMBIDFromURL ¶
GetArtistMBIDFromURL attempts to find the MBID of the artist corresponding to url. name should contain the artist name as seen online.
Types ¶
type Config ¶
type Config struct { // ExtractTrackArtists indicates that artist names should be extracted from the // beginnings of track names, e.g. "Artist - Title". This is currently only used // for Bandcamp pages. ExtractTrackArtists bool // CountryCode contains the ISO 3166 code of the country that should be used when requesting // album data, e.g. "US" or "DE". This is currently only used for the Tidal API. CountryCode string // DisallowNetwork indicates that network requests should not be made. // This can be set by tests. DisallowNetwork bool }
Config is passed to Provider implementations to configure their behavior.
type Provider ¶
type Provider interface { // CleanURL returns a normalized version of the supplied URL. // An error is returned if the URL doesn't match a supported format for the provider. CleanURL(orig string) (string, error) // NeedsPage returns true if Release needs the page to be fetched and passed to it. // Providers should return false if they use some other API to get data. NeedsPage() bool // Release extracts release information from the supplied page. // If NeedsPage returns false, then the supplied page will be nil. // The img return value is nil if a cover image is not found. Release(ctx context.Context, page *web.Page, url string, db *mbdb.DB, cfg *Config) ( rel *seed.Release, img *seed.Info, err error) // ExampleURL returns an example URL that can be displayed to the user. ExampleURL() string }
Provider gets information from an online music provider.
Click to show internal directories.
Click to hide internal directories.