diff --git a/src/Sonarr.Api.V3/History/HistoryModule.cs b/src/Sonarr.Api.V3/History/HistoryModule.cs index 4e24a39df..2a0e2cc97 100644 --- a/src/Sonarr.Api.V3/History/HistoryModule.cs +++ b/src/Sonarr.Api.V3/History/HistoryModule.cs @@ -66,6 +66,7 @@ private PagingResource GetHistory(PagingResource f.Key == "eventType"); var episodeIdFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "episodeId"); + var downloadIdFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "downloadId"); if (eventTypeFilter != null) { @@ -78,6 +79,12 @@ private PagingResource GetHistory(PagingResource h.EpisodeId == episodeId); } + + if (downloadIdFilter != null) + { + var downloadId = downloadIdFilter.Value; + pagingSpec.FilterExpressions.Add(h => h.DownloadId == downloadId); + } return ApplyToPage(_historyService.Paged, pagingSpec, h => MapToResource(h, includeSeries, includeEpisode)); }