getArtists.view implemented

This commit is contained in:
Deluan
2016-03-27 20:35:10 -04:00
parent 3cc92a32bd
commit 0a137657fe
3 changed files with 20 additions and 3 deletions
+16 -3
View File
@@ -32,9 +32,7 @@ func (c *BrowsingController) GetMusicFolders() {
c.SendResponse(response)
}
func (c *BrowsingController) GetIndexes() {
ifModifiedSince := c.ParamTime("ifModifiedSince", time.Time{})
func (c *BrowsingController) getArtistIndex(ifModifiedSince time.Time) responses.Indexes {
indexes, lastModified, err := c.browser.Indexes(ifModifiedSince)
if err != nil {
beego.Error("Error retrieving Indexes:", err)
@@ -56,12 +54,27 @@ func (c *BrowsingController) GetIndexes() {
res.Index[i].Artists[j].AlbumCount = a.AlbumCount
}
}
return res
}
func (c *BrowsingController) GetIndexes() {
ifModifiedSince := c.ParamTime("ifModifiedSince", time.Time{})
res := c.getArtistIndex(ifModifiedSince)
response := c.NewEmpty()
response.Indexes = &res
c.SendResponse(response)
}
func (c *BrowsingController) GetArtists() {
res := c.getArtistIndex(time.Time{})
response := c.NewEmpty()
response.Artist = &res
c.SendResponse(response)
}
func (c *BrowsingController) GetMusicDirectory() {
id := c.RequiredParamString("id", "id parameter required")
+3
View File
@@ -22,6 +22,9 @@ type Subsonic struct {
Starred *Starred `xml:"starred,omitempty" json:"starred,omitempty"`
NowPlaying *NowPlaying `xml:"nowPlaying,omitempty" json:"nowPlaying,omitempty"`
Song *Child `xml:"song,omitempty" json:"song,omitempty"`
// ID3
Artist *Indexes `xml:"artists,omitempty" json:"artists,omitempty"`
}
type JsonWrapper struct {