getAlbumList2.view done

This commit is contained in:
Deluan
2016-03-27 23:04:05 -04:00
parent 4b38f9238c
commit 82576223dc
4 changed files with 28 additions and 0 deletions
+23
View File
@@ -53,6 +53,29 @@ func (c *AlbumListController) GetAlbumList() {
c.SendResponse(response)
}
func (c *AlbumListController) GetAlbumList2() {
typ := c.RequiredParamString("type", "Required string parameter 'type' is not present")
method, found := c.types[typ]
if !found {
beego.Error("albumList2 type", typ, "not implemented!")
c.SendError(responses.ErrorGeneric, "Not implemented!")
}
offset := c.ParamInt("offset", 0)
size := utils.MinInt(c.ParamInt("size", 0), 500)
albums, err := method(offset, size)
if err != nil {
beego.Error("Error retrieving albums:", err)
c.SendError(responses.ErrorGeneric, "Internal Error")
}
response := c.NewEmpty()
response.AlbumList2 = &responses.AlbumList{Album: c.ToAlbums(albums)}
c.SendResponse(response)
}
func (c *AlbumListController) GetStarred() {
albums, mediaFiles, err := c.listGen.GetAllStarred()
if err != nil {