🐛 Add missing artists to mb data
This commit is contained in:
parent
8860c53d45
commit
dac33a7688
1 changed files with 31 additions and 8 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue