diff --git a/src/Lidarr.Api.V1/History/HistoryModule.cs b/src/Lidarr.Api.V1/History/HistoryModule.cs index 4135ed0ca..b8452266f 100644 --- a/src/Lidarr.Api.V1/History/HistoryModule.cs +++ b/src/Lidarr.Api.V1/History/HistoryModule.cs @@ -70,6 +70,7 @@ namespace Lidarr.Api.V1.History var eventTypeFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "eventType"); var albumIdFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "albumId"); + var downloadIdFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "downloadId"); if (eventTypeFilter != null) { @@ -83,6 +84,12 @@ namespace Lidarr.Api.V1.History pagingSpec.FilterExpressions.Add(h => h.AlbumId == albumId); } + if (downloadIdFilter != null) + { + var downloadId = downloadIdFilter.Value; + pagingSpec.FilterExpressions.Add(h => h.DownloadId == downloadId); + } + return ApplyToPage(_historyService.Paged, pagingSpec, h => MapToResource(h, includeArtist, includeAlbum, includeTrack)); }