diff --git a/api/artist.go b/api/artist.go index 00f185d..90bd18a 100644 --- a/api/artist.go +++ b/api/artist.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "strings" + "time" "arimelody-web/admin" "arimelody-web/global" @@ -38,8 +39,12 @@ func ServeArtist(artist *model.Artist) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { type ( creditJSON struct { - Role string `json:"role"` - Primary bool `json:"primary"` + ID string `json:"id"` + Title string `json:"title"` + ReleaseDate time.Time `json:"releaseDate" db:"release_date"` + Artwork string `json:"artwork"` + Role string `json:"role"` + Primary bool `json:"primary"` } artistJSON struct { *model.Artist @@ -60,6 +65,10 @@ func ServeArtist(artist *model.Artist) http.Handler { var credits = map[string]creditJSON{} for _, credit := range dbCredits { credits[credit.Release.ID] = creditJSON{ + ID: credit.Release.ID, + Title: credit.Release.Title, + ReleaseDate: credit.Release.ReleaseDate, + Artwork: credit.Release.Artwork, Role: credit.Role, Primary: credit.Primary, }