Documentation ¶
Index ¶
- Constants
- type Area
- type Artist
- type ArtistCredit
- type ArtistsPage
- type AttributeIds
- type CoverArtArchive
- type Genre
- type Label
- type LabelInfo
- type LifeSpan
- type Media
- type MusicBrainz
- func (m *MusicBrainz) ArtistDetail(arid string) (*Artist, error)
- func (m *MusicBrainz) ArtistReleases(artist, arid string) ([]Release, error)
- func (m *MusicBrainz) CoverArtArchive(reid string, rgid string) (*coverArt, error)
- func (m *MusicBrainz) Release(reid string) (*Release, error)
- func (m *MusicBrainz) ReleaseGroup(rgid string) (*ReleaseGroup, error)
- func (m *MusicBrainz) Releases(rgid string) ([]Release, error)
- func (m *MusicBrainz) SearchArtist(name string) *Artist
- func (m *MusicBrainz) SearchArtistID(arid string) *Artist
- func (m *MusicBrainz) SearchReleaseGroup(arid string, name string) (*SearchResult, error)
- type Rating
- type Recording
- type Relation
- type Release
- type ReleaseGroup
- type ReleasesPage
- type SearchResult
- type Series
- type Tag
- type Track
- type URL
- type Work
Constants ¶
View Source
const ( PrimaryTypeAlbum = "Album" PrimaryTypeSingle = "Single" PrimaryTypeEP = "EP" PrimaryTypeBroadcast = "Broadcast" PrimaryTypeOther = "Other" TypeCompilation = "Compilation" TypeSoundtrack = "Soundtrack" TypeSpokenword = "Spokenword" TypeInterview = "Interview" TypeAudiobook = "Audiobook" TypeAudioDrama = "Audio drama" TypeLive = "Live" TypeRemix = "Remix" TypeDJMix = "DJ-mix" TypeMixtapeStreet = "Mixtape/Street" TypeNone = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artist ¶
type Artist struct { ID string `json:"id"` Score int `json:"score"` Name string `json:"name"` SortName string `json:"sort-name"` Country string `json:"country"` Disambiguation string `json:"disambiguation"` Type string `json:"type"` Genres []Genre `json:"genres"` Tags []Tag `json:"tags"` Area Area `json:"area"` BeginArea Area `json:"begin-area"` EndArea Area `json:"end-area"` LifeSpan LifeSpan `json:"life-span"` Relations []Relation `json:"relations"` }
func (Artist) PrimaryGenre ¶
func (Artist) SortedGenres ¶
type ArtistCredit ¶
type ArtistsPage ¶
type AttributeIds ¶
type CoverArtArchive ¶
type LifeSpan ¶
type LifeSpan struct { Ended bool `json:"ended"` Begin string `json:"begin"` End string `json:"end"` }
TODO artist detail get detail for each artist - lifespan, url rel links, genres json api: http://musicbrainz.org/ws/2/artist/3798b104-01cb-484c-a3b0-56adc6399b80?inc=genres+url-rels&fmt=json
type MusicBrainz ¶
type MusicBrainz struct {
// contains filtered or unexported fields
}
func NewMusicBrainz ¶
func NewMusicBrainz(client client.Getter) *MusicBrainz
func (*MusicBrainz) ArtistDetail ¶
func (m *MusicBrainz) ArtistDetail(arid string) (*Artist, error)
func (*MusicBrainz) ArtistReleases ¶
func (m *MusicBrainz) ArtistReleases(artist, arid string) ([]Release, error)
Get all releases for an artist from MusicBrainz.
func (*MusicBrainz) CoverArtArchive ¶
func (m *MusicBrainz) CoverArtArchive(reid string, rgid string) (*coverArt, error)
func (*MusicBrainz) ReleaseGroup ¶
func (m *MusicBrainz) ReleaseGroup(rgid string) (*ReleaseGroup, error)
func (*MusicBrainz) SearchArtist ¶
func (m *MusicBrainz) SearchArtist(name string) *Artist
Search for artist by name using MusicBrainz.
func (*MusicBrainz) SearchArtistID ¶
func (m *MusicBrainz) SearchArtistID(arid string) *Artist
Obtain artist details using MusicBrainz artist ID.
func (*MusicBrainz) SearchReleaseGroup ¶
func (m *MusicBrainz) SearchReleaseGroup(arid string, name string) (*SearchResult, error)
type Recording ¶
type Recording struct { ID string `json:"id"` Length int `json:"length"` Title string `json:"title"` Relations []Relation `json:"relations"` ArtistCredit []ArtistCredit `json:"artist-credit"` FirstReleaseDate string `json:"first-release-date"` }
func (Recording) FirstReleaseTime ¶
type Relation ¶
type Relation struct { Type string `json:"type"` TargetType string `json:"target-type"` Artist Artist `json:"artist"` Attributes []string `json:"attributes"` AttributeIds AttributeIds `json:"attribute-ids"` Work Work `json:"work"` URL URL `json:"url"` Series Series `json:"series"` }
release-group series: type="part of", target-type="series", see series release recording series: type="part of", target-type="series", see series single: type="single from", target-type="release_group", see release_group
type Release ¶
type Release struct { ID string `json:"id"` Title string `json:"title"` Date string `json:"date"` Disambiguation string `json:"disambiguation"` Country string `json:"country"` Status string `json:"status"` Asin string `json:"asin"` Relations []Relation `json:"relations"` LabelInfo []LabelInfo `json:"label-info"` Media []Media `json:"media"` ReleaseGroup ReleaseGroup `json:"release-group"` CoverArtArchive CoverArtArchive `json:"cover-art-archive"` ArtistCredit []ArtistCredit `json:"artist-credit"` }
func (Release) TotalDiscs ¶
func (Release) TotalTracks ¶
type ReleaseGroup ¶
type ReleaseGroup struct { ID string `json:"id"` Title string `json:"title"` Disambiguation string `json:"disambiguation"` PrimaryType string `json:"primary-type"` SecondaryTypes []string `json:"secondary-types"` Rating Rating `json:"rating"` FirstReleaseDate string `json:"first-release-date"` Tags []Tag `json:"tags"` Genres []Genre `json:"genres"` Releases []Release `json:"releases"` ArtistCredit []ArtistCredit `json:"artist-credit"` Relations []Relation `json:"relations"` }
func (ReleaseGroup) FirstReleaseTime ¶
func (rg ReleaseGroup) FirstReleaseTime() time.Time
func (ReleaseGroup) SecondaryType ¶
func (rg ReleaseGroup) SecondaryType() string
func (ReleaseGroup) SortedGenres ¶
func (rg ReleaseGroup) SortedGenres() []Genre
type ReleasesPage ¶
type SearchResult ¶
type SearchResult struct { Created string `json:"created"` Count int `json:"count"` Offset int `json:"offset"` ReleaseGroups []ReleaseGroup `json:"release-groups"` }
type Series ¶
type Series struct { ID string `json:"id"` Name string `json:"name"` Disambiguation string `json:"disambiguation"` Type string `json:"type"` }
type="Release group series" type="Recording series" (for recording in release)
type Track ¶
type Track struct { Title string `json:"title"` Position int `json:"position"` ArtistCredit []ArtistCredit `json:"artist-credit"` Recording Recording `json:"recording"` }
Click to show internal directories.
Click to hide internal directories.