From bda2b9b0b8ff0df3d7af2ca7c0d13ed0671d715a Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 4 Jan 2024 11:21:53 +0200 Subject: [PATCH] Fixed: Filter history by multiple event types --- src/Radarr.Api.V3/History/HistoryController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Radarr.Api.V3/History/HistoryController.cs b/src/Radarr.Api.V3/History/HistoryController.cs index c82e7a85c..b7d269677 100644 --- a/src/Radarr.Api.V3/History/HistoryController.cs +++ b/src/Radarr.Api.V3/History/HistoryController.cs @@ -61,15 +61,15 @@ namespace Radarr.Api.V3.History [HttpGet] [Produces("application/json")] - public PagingResource GetHistory([FromQuery] PagingRequestResource paging, bool includeMovie, int? eventType, string downloadId, [FromQuery] int[] movieIds = null, [FromQuery] int[] languages = null, [FromQuery] int[] quality = null) + public PagingResource 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(paging); var pagingSpec = pagingResource.MapToPagingSpec("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().ToArray(); + pagingSpec.FilterExpressions.Add(v => filterValues.Contains(v.EventType)); } if (downloadId.IsNotNullOrWhiteSpace())