mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 04:00:38 +03:00
Max size to return == 500
This commit is contained in:
parent
9783db1781
commit
184bdc0118
@ -32,11 +32,12 @@ func (c *GetAlbumListController) Get() {
|
||||
|
||||
if !found {
|
||||
beego.Error("getAlbumList type", typ, "not implemented!")
|
||||
c.SendError(responses.ERROR_GENERIC, "Not implemented yet!")
|
||||
c.SendError(responses.ERROR_GENERIC, "Not implemented!")
|
||||
}
|
||||
|
||||
qo.Size = 10
|
||||
c.Ctx.Input.Bind(&qo.Size, "size")
|
||||
qo.Size = utils.MinInt(qo.Size, 500)
|
||||
c.Ctx.Input.Bind(&qo.Offset, "offset")
|
||||
|
||||
albums, err := c.albumRepo.GetAll(qo)
|
||||
|
@ -41,6 +41,12 @@ func TestGetAlbumList(t *testing.T) {
|
||||
|
||||
So(w.Body, ShouldReceiveError, responses.ERROR_GENERIC)
|
||||
})
|
||||
Convey("Max size = 500", func() {
|
||||
_, w := Get(AddParams("/rest/getAlbumList.view", "type=newest", "size=501"), "TestGetAlbumList")
|
||||
So(w.Body, ShouldBeAValid, responses.AlbumList{})
|
||||
So(mockAlbumRepo.Options.Size, ShouldEqual, 500)
|
||||
So(mockAlbumRepo.Options.Alpha, ShouldBeTrue)
|
||||
})
|
||||
Convey("Type == newest", func() {
|
||||
_, w := Get(AddParams("/rest/getAlbumList.view", "type=newest"), "TestGetAlbumList")
|
||||
So(w.Body, ShouldBeAValid, responses.AlbumList{})
|
||||
|
Loading…
x
Reference in New Issue
Block a user