|
|
|
@ -61,15 +61,15 @@ namespace Radarr.Api.V3.History
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
public PagingResource<HistoryResource> GetHistory([FromQuery] PagingRequestResource paging, bool includeMovie, int? eventType, string downloadId, [FromQuery] int[] movieIds = null, [FromQuery] int[] languages = null, [FromQuery] int[] quality = null)
|
|
|
|
|
public PagingResource<HistoryResource> GetHistory([FromQuery] PagingRequestResource paging, bool includeMovie, [FromQuery(Name = "eventType")] int[] eventTypes, string downloadId, [FromQuery] int[] movieIds = null, [FromQuery] int[] languages = null, [FromQuery] int[] quality = null)
|
|
|
|
|
{
|
|
|
|
|
var pagingResource = new PagingResource<HistoryResource>(paging);
|
|
|
|
|
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, MovieHistory>("date", SortDirection.Descending);
|
|
|
|
|
|
|
|
|
|
if (eventType.HasValue)
|
|
|
|
|
if (eventTypes != null && eventTypes.Any())
|
|
|
|
|
{
|
|
|
|
|
var filterValue = (MovieHistoryEventType)eventType.Value;
|
|
|
|
|
pagingSpec.FilterExpressions.Add(v => v.EventType == filterValue);
|
|
|
|
|
var filterValues = eventTypes.Cast<MovieHistoryEventType>().ToArray();
|
|
|
|
|
pagingSpec.FilterExpressions.Add(v => filterValues.Contains(v.EventType));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (downloadId.IsNotNullOrWhiteSpace())
|
|
|
|
|