diff --git a/media/brainz.go b/media/brainz.go index d931582..91fe0b0 100644 --- a/media/brainz.go +++ b/media/brainz.go @@ -11,24 +11,47 @@ import ( type MbRecording struct { Id string + Isrcs []string FirstReleaseDate string `json:"first-release-date"` Length int Title string Video bool Releases []MbRelease + Genres []MbGenre +} + +type MbGenre struct { + Id string + Name string } type MbRelease struct { - Id string - Country string - Date string - Media []MbMedia - Status string - StatusId string `json:"status-id"` - Title string + Id string + Country string + Date string + Media []MbMedia + Status string + StatusId string `json:"status-id"` + ArtistCredit []MbArtistCredit `json:"artist-credit"` + Title string + Genres []MbGenre // ReleaseEvents []MbReleaseEvent `json:"release-events"` } +type MbArtistCredit struct { + Name string + Artist MbArtist +} + +type MbArtist struct { + Id string + Name string + TypeId string `json:"type-id"` + Type string + SortName string `json:"sort-name"` + Genres []MbGenre +} + type MbMedia struct { FormatId string `json:"format-id"` Position int @@ -60,7 +83,7 @@ func FillMbRecording(rec *MbRecording) error { } q := req.URL.Query() q.Add("fmt", "json") - q.Add("inc", "releases+media") + q.Add("inc", "releases+media+artist-credits+isrcs+genres") req.URL.RawQuery = q.Encode() req.Header.Set("User-Agent", config.UserAgent)