only return artist cover art if we have cached it

This commit is contained in:
sentriz
2023-09-14 00:32:48 +01:00
parent 5c6a59ac38
commit df2c0707dd
13 changed files with 162 additions and 225 deletions

View File

@@ -99,7 +99,9 @@ func NewArtistByTags(a *db.Artist) *Artist {
Name: a.Name,
AlbumCount: a.AlbumCount,
AverageRating: formatRating(a.AverageRating),
CoverID: a.SID(),
}
if a.Info != nil && a.Info.ImageURL != "" {
r.CoverID = a.SID()
}
if a.ArtistStar != nil {
r.Starred = &a.ArtistStar.StarDate

View File

@@ -284,22 +284,15 @@ type Playlist struct {
List []*TrackChild `xml:"entry,omitempty" json:"entry,omitempty"`
}
type SimilarArtist struct {
ID *specid.ID `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
CoverArt *specid.ID `xml:"coverArt,attr" json:"coverArt"`
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
}
type ArtistInfo struct {
Biography string `xml:"biography" json:"biography"`
MusicBrainzID string `xml:"musicBrainzId" json:"musicBrainzId"`
LastFMURL string `xml:"lastFmUrl" json:"lastFmUrl"`
SmallImageURL string `xml:"smallImageUrl" json:"smallImageUrl"`
MediumImageURL string `xml:"mediumImageUrl" json:"mediumImageUrl"`
LargeImageURL string `xml:"largeImageUrl" json:"largeImageUrl"`
ArtistImageURL string `xml:"artistImageUrl" json:"artistImageUrl"` // not sure where this comes from but other clients seem to expect it
SimilarArtist []*SimilarArtist `xml:"similarArtist,omitempty" json:"similarArtist,omitempty"`
Biography string `xml:"biography" json:"biography"`
MusicBrainzID string `xml:"musicBrainzId" json:"musicBrainzId"`
LastFMURL string `xml:"lastFmUrl" json:"lastFmUrl"`
SmallImageURL string `xml:"smallImageUrl" json:"smallImageUrl"`
MediumImageURL string `xml:"mediumImageUrl" json:"mediumImageUrl"`
LargeImageURL string `xml:"largeImageUrl" json:"largeImageUrl"`
ArtistImageURL string `xml:"artistImageUrl" json:"artistImageUrl"` // not sure where this comes from but other clients seem to expect it
Similar []*Artist `xml:"similarArtist,omitempty" json:"similarArtist,omitempty"`
}
type Genres struct {