home to your local SPACEGIRL 💫 arimelody.space
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add more detail to credits on /api/v1/artist/{id}

+11 -2
+11 -2
api/artist.go
··· 8 8 "os" 9 9 "path/filepath" 10 10 "strings" 11 + "time" 11 12 12 13 "arimelody-web/admin" 13 14 "arimelody-web/global" ··· 38 39 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 39 40 type ( 40 41 creditJSON struct { 41 - Role string `json:"role"` 42 - Primary bool `json:"primary"` 42 + ID string `json:"id"` 43 + Title string `json:"title"` 44 + ReleaseDate time.Time `json:"releaseDate" db:"release_date"` 45 + Artwork string `json:"artwork"` 46 + Role string `json:"role"` 47 + Primary bool `json:"primary"` 43 48 } 44 49 artistJSON struct { 45 50 *model.Artist ··· 60 65 var credits = map[string]creditJSON{} 61 66 for _, credit := range dbCredits { 62 67 credits[credit.Release.ID] = creditJSON{ 68 + ID: credit.Release.ID, 69 + Title: credit.Release.Title, 70 + ReleaseDate: credit.Release.ReleaseDate, 71 + Artwork: credit.Release.Artwork, 63 72 Role: credit.Role, 64 73 Primary: credit.Primary, 65 74 }