Adding song and album counts

This commit is contained in:
Deluan
2016-03-27 20:13:00 -04:00
parent 167e7a1825
commit 3cc92a32bd
9 changed files with 32 additions and 7 deletions
+1
View File
@@ -172,5 +172,6 @@ func (c *BaseAPIController) ToChild(entry engine.Entry) responses.Child {
child.ArtistId = entry.ArtistId
child.Type = entry.Type
child.UserRating = entry.UserRating
child.SongCount = entry.SongCount
return child
}
+1
View File
@@ -53,6 +53,7 @@ func (c *BrowsingController) GetIndexes() {
for j, a := range idx.Artists {
res.Index[i].Artists[j].Id = a.ArtistId
res.Index[i].Artists[j].Name = a.Artist
res.Index[i].Artists[j].AlbumCount = a.AlbumCount
}
}
+4 -2
View File
@@ -47,8 +47,9 @@ type MusicFolders struct {
}
type Artist struct {
Id string `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
Id string `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
/*
<xs:attribute name="starred" type="xs:dateTime" use="optional"/> <!-- Added in 1.10.1 -->
<xs:attribute name="userRating" type="sub:UserRating" use="optional"/> <!-- Added in 1.13.0 -->
@@ -94,6 +95,7 @@ type Child struct {
ArtistId string `xml:"artistId,attr,omitempty" json:"artistId,omitempty"`
Type string `xml:"type,attr,omitempty" json:"type,omitempty"`
UserRating int `xml:"userRating,attr,omitempty" json:"userRating,omitempty"`
SongCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"`
/*
<xs:attribute name="isVideo" type="xs:boolean" use="optional"/> <!-- Added in 1.4.1 -->
<xs:attribute name="averageRating" type="sub:AverageRating" use="optional"/> <!-- Added in 1.6.0 -->