feat(subsonic): expose all album genres in a list of subsonic api
expose album genres from getArtist
This commit is contained in:
@@ -15,7 +15,6 @@ func NewAlbumByTags(a *db.Album, artists []*db.Artist) *Album {
|
||||
Name: a.TagTitle,
|
||||
Year: a.TagYear,
|
||||
TrackCount: a.ChildCount,
|
||||
Genre: strings.Join(a.GenreStrings(), ", "),
|
||||
Duration: a.Duration,
|
||||
AverageRating: formatRating(a.AverageRating),
|
||||
}
|
||||
@@ -41,6 +40,12 @@ func NewAlbumByTags(a *db.Album, artists []*db.Artist) *Album {
|
||||
Name: a.Name,
|
||||
})
|
||||
}
|
||||
if len(a.Genres) > 0 {
|
||||
ret.Genre = a.Genres[0].Name
|
||||
}
|
||||
for _, g := range a.Genres {
|
||||
ret.Genres = append(ret.Genres, g.Name)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ type Album struct {
|
||||
TrackCount int `xml:"songCount,attr" json:"songCount"`
|
||||
Duration int `xml:"duration,attr" json:"duration"`
|
||||
Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"`
|
||||
Genres []string `xml:"genres,omitempty" json:"genres,omitempty"`
|
||||
Year int `xml:"year,attr,omitempty" json:"year,omitempty"`
|
||||
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
|
||||
// star / rating
|
||||
|
||||
Reference in New Issue
Block a user