ctrlsubsonic: implement getGenres

This commit is contained in:
Duncan Overbruck
2020-03-02 16:25:50 +01:00
parent ae31d4a893
commit 14d68f748c
5 changed files with 31 additions and 16 deletions

View File

@@ -72,3 +72,11 @@ func NewArtistByTags(a *db.Artist) *Artist {
AlbumCount: a.AlbumCount,
}
}
func NewGenre(g *db.Genre) *Genre {
return &Genre{
Name: g.Name,
AlbumCount: g.AlbumCount,
SongCount: g.TrackCount,
}
}

View File

@@ -250,8 +250,9 @@ type Genres struct {
}
type Genre struct {
SongCount string `xml:"songCount,attr"`
AlbumCount string `xml:"albumCount,attr"`
Name string `xml:",chardata",json:"value"`
SongCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"`
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
}
type PlayQueue struct {