getArtists.view implemented
This commit is contained in:
+16
-3
@@ -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")
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user