New: Added downloadId filter to history api

Co-Authored-By: taloth <taloth@users.noreply.github.com>
pull/6/head
Qstick 5 years ago
parent 07fca1b6fc
commit 47f2da9b3d

@ -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));
}

Loading…
Cancel
Save