Empty getArtistInfo2 response if lastfm_api_key is not set

DSub will error out in Artists views if browse by tags is enabled
and getArtistInfo2 returns an error.
This commit is contained in:
Duncan Overbruck
2020-07-24 15:36:41 +02:00
committed by Senan Kelly
parent 9f73d5719c
commit 71534ced07

View File

@@ -224,7 +224,9 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
}
apiKey := c.DB.GetSetting("lastfm_api_key")
if apiKey == "" {
return spec.NewError(0, "please ask your admin to set the last.fm api key")
sub := spec.NewResponse()
sub.ArtistInfoTwo = &spec.ArtistInfo{}
return sub
}
artist := &db.Artist{}
err = c.DB.