🐛 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 {
|
type MbRecording struct {
|
||||||
Id string
|
Id string
|
||||||
|
Isrcs []string
|
||||||
FirstReleaseDate string `json:"first-release-date"`
|
FirstReleaseDate string `json:"first-release-date"`
|
||||||
Length int
|
Length int
|
||||||
Title string
|
Title string
|
||||||
Video bool
|
Video bool
|
||||||
Releases []MbRelease
|
Releases []MbRelease
|
||||||
|
Genres []MbGenre
|
||||||
|
}
|
||||||
|
|
||||||
|
type MbGenre struct {
|
||||||
|
Id string
|
||||||
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
type MbRelease struct {
|
type MbRelease struct {
|
||||||
Id string
|
Id string
|
||||||
Country string
|
Country string
|
||||||
Date string
|
Date string
|
||||||
Media []MbMedia
|
Media []MbMedia
|
||||||
Status string
|
Status string
|
||||||
StatusId string `json:"status-id"`
|
StatusId string `json:"status-id"`
|
||||||
Title string
|
ArtistCredit []MbArtistCredit `json:"artist-credit"`
|
||||||
|
Title string
|
||||||
|
Genres []MbGenre
|
||||||
// ReleaseEvents []MbReleaseEvent `json:"release-events"`
|
// 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 {
|
type MbMedia struct {
|
||||||
FormatId string `json:"format-id"`
|
FormatId string `json:"format-id"`
|
||||||
Position int
|
Position int
|
||||||
|
|
@ -60,7 +83,7 @@ func FillMbRecording(rec *MbRecording) error {
|
||||||
}
|
}
|
||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
q.Add("fmt", "json")
|
q.Add("fmt", "json")
|
||||||
q.Add("inc", "releases+media")
|
q.Add("inc", "releases+media+artist-credits+isrcs+genres")
|
||||||
req.URL.RawQuery = q.Encode()
|
req.URL.RawQuery = q.Encode()
|
||||||
req.Header.Set("User-Agent", config.UserAgent)
|
req.Header.Set("User-Agent", config.UserAgent)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue