return more counts
This commit is contained in:
@@ -66,6 +66,7 @@ func (c *Controller) ServeGetArtist(r *http.Request) *spec.Response {
|
|||||||
for i, album := range artist.Albums {
|
for i, album := range artist.Albums {
|
||||||
sub.Artist.Albums[i] = spec.NewAlbumByTags(album, artist)
|
sub.Artist.Albums[i] = spec.NewAlbumByTags(album, artist)
|
||||||
}
|
}
|
||||||
|
sub.Artist.AlbumCount = len(artist.Albums)
|
||||||
return sub
|
return sub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,11 +94,11 @@ type Album struct {
|
|||||||
ParentID int `xml:"parent,attr,omitempty" json:"parent,omitempty"`
|
ParentID int `xml:"parent,attr,omitempty" json:"parent,omitempty"`
|
||||||
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"`
|
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"`
|
||||||
// browsing by tags (getAlbumList2)
|
// browsing by tags (getAlbumList2)
|
||||||
Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
|
Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
|
||||||
TrackCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"`
|
TrackCount int `xml:"songCount,attr" json:"songCount"`
|
||||||
Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"`
|
Duration int `xml:"duration,attr" json:"duration"`
|
||||||
Created time.Time `xml:"created,attr,omitempty" json:"created,omitempty"`
|
Created time.Time `xml:"created,attr,omitempty" json:"created,omitempty"`
|
||||||
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
|
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RandomTracks struct {
|
type RandomTracks struct {
|
||||||
@@ -134,11 +134,11 @@ type Artists struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Artist struct {
|
type Artist struct {
|
||||||
ID int `xml:"id,attr,omitempty" json:"id"`
|
ID int `xml:"id,attr,omitempty" json:"id"`
|
||||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
Name string `xml:"name,attr,omitempty" json:"name"`
|
||||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
|
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
|
||||||
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
|
AlbumCount int `xml:"albumCount,attr" json:"albumCount"`
|
||||||
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Indexes struct {
|
type Indexes struct {
|
||||||
@@ -212,12 +212,12 @@ type Playlists struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Playlist struct {
|
type Playlist struct {
|
||||||
ID int `xml:"id,attr" json:"id,omitempty"`
|
ID int `xml:"id,attr" json:"id"`
|
||||||
Name string `xml:"name,attr" json:"name,omitempty"`
|
Name string `xml:"name,attr" json:"name"`
|
||||||
Comment string `xml:"comment,attr" json:"comment,omitempty"`
|
Comment string `xml:"comment,attr" json:"comment"`
|
||||||
Owner string `xml:"owner,attr" json:"owner,omitempty"`
|
Owner string `xml:"owner,attr" json:"owner"`
|
||||||
SongCount string `xml:"songCount,attr" json:"songCount,omitempty"`
|
SongCount int `xml:"songCount,attr" json:"songCount"`
|
||||||
Created string `xml:"created,attr" json:"created,omitempty"`
|
Created string `xml:"created,attr" json:"created"`
|
||||||
Duration string `xml:"duration,attr" json:"duration,omitempty"`
|
Duration string `xml:"duration,attr" json:"duration,omitempty"`
|
||||||
Public bool `xml:"public,attr" json:"public,omitempty"`
|
Public bool `xml:"public,attr" json:"public,omitempty"`
|
||||||
List []*TrackChild `xml:"entry" json:"entry,omitempty"`
|
List []*TrackChild `xml:"entry" json:"entry,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user