mirror of
https://github.com/Radarr/Radarr
synced 2025-01-01 12:54:21 +00:00
/movies without pagesize or page gives back the old format.
This commit is contained in:
parent
0d60375a56
commit
665832f0cc
1 changed files with 10 additions and 7 deletions
|
@ -123,7 +123,13 @@ protected Func<PagingResource<TResource>, PagingResource<TResource>> GetResource
|
|||
|
||||
Get[ROOT_ROUTE] = options =>
|
||||
{
|
||||
var resource = GetResourcePaged(ReadPagingResourceFromRequest());
|
||||
var pagingSpec = ReadPagingResourceFromRequest();
|
||||
if (pagingSpec.Page == 0 && pagingSpec.PageSize == 0)
|
||||
{
|
||||
var all = GetResourceAll();
|
||||
return all.AsResponse();
|
||||
}
|
||||
var resource = GetResourcePaged(pagingSpec);
|
||||
return resource.AsResponse();
|
||||
};
|
||||
}
|
||||
|
@ -214,15 +220,12 @@ protected TResource ReadResourceFromRequest(bool skipValidate = false)
|
|||
private PagingResource<TResource> ReadPagingResourceFromRequest()
|
||||
{
|
||||
int pageSize;
|
||||
if (!int.TryParse(Request.Query.PageSize.ToString(), out pageSize))
|
||||
{
|
||||
pageSize = 100000;
|
||||
}
|
||||
if (pageSize == 0) pageSize = 10;
|
||||
int.TryParse(Request.Query.PageSize.ToString(), out pageSize);
|
||||
if (pageSize == 0) pageSize = 0;
|
||||
|
||||
int page;
|
||||
int.TryParse(Request.Query.Page.ToString(), out page);
|
||||
if (page == 0) page = 1;
|
||||
if (page == 0) page = 0;
|
||||
|
||||
|
||||
var pagingResource = new PagingResource<TResource>
|
||||
|
|
Loading…
Reference in a new issue