mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Paging params in API docs
(cherry picked from commit bfaa7291e14a8d3847ef2154a52c363944560803) Closes #2975 Closes #2991
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Core.AuthorStats;
|
||||
using NzbDrone.Core.Books;
|
||||
@@ -26,9 +25,9 @@ namespace Readarr.Api.V1.Wanted
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public PagingResource<BookResource> GetMissingBooks(bool includeAuthor = false)
|
||||
public PagingResource<BookResource> GetMissingBooks([FromQuery] PagingRequestResource paging, bool includeAuthor = false, bool monitored = true)
|
||||
{
|
||||
var pagingResource = Request.ReadPagingResourceFromRequest<BookResource>();
|
||||
var pagingResource = new PagingResource<BookResource>(paging);
|
||||
var pagingSpec = new PagingSpec<Book>
|
||||
{
|
||||
Page = pagingResource.Page,
|
||||
@@ -37,9 +36,7 @@ namespace Readarr.Api.V1.Wanted
|
||||
SortDirection = pagingResource.SortDirection
|
||||
};
|
||||
|
||||
var monitoredFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "monitored");
|
||||
|
||||
if (monitoredFilter != null && monitoredFilter.Value == "false")
|
||||
if (monitored)
|
||||
{
|
||||
pagingSpec.FilterExpressions.Add(v => v.Monitored == false || v.Author.Value.Monitored == false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user