From 354533871e56e410eab83075fcb70a5eccd7866b Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 12 Jan 2024 03:34:22 +0200 Subject: [PATCH] Fixed: Filter history by multiple event types --- src/Lidarr.Api.V1/History/HistoryController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Lidarr.Api.V1/History/HistoryController.cs b/src/Lidarr.Api.V1/History/HistoryController.cs index 150ef3b08..3cf30b57e 100644 --- a/src/Lidarr.Api.V1/History/HistoryController.cs +++ b/src/Lidarr.Api.V1/History/HistoryController.cs @@ -68,15 +68,15 @@ namespace Lidarr.Api.V1.History [HttpGet] [Produces("application/json")] - public PagingResource GetHistory([FromQuery] PagingRequestResource paging, bool includeArtist, bool includeAlbum, bool includeTrack, int? eventType, int? albumId, string downloadId, [FromQuery] int[] artistIds = null, [FromQuery] int[] quality = null) + public PagingResource GetHistory([FromQuery] PagingRequestResource paging, bool includeArtist, bool includeAlbum, bool includeTrack, [FromQuery(Name = "eventType")] int[] eventTypes, int? albumId, string downloadId, [FromQuery] int[] artistIds = 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 = (EntityHistoryEventType)eventType.Value; - pagingSpec.FilterExpressions.Add(v => v.EventType == filterValue); + var filterValues = eventTypes.Cast().ToArray(); + pagingSpec.FilterExpressions.Add(v => filterValues.Contains(v.EventType)); } if (albumId.HasValue)