mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-13 07:23:14 +00:00
New: Added downloadId filter to history api
Co-Authored-By: taloth <taloth@users.noreply.github.com>
This commit is contained in:
parent
07fca1b6fc
commit
47f2da9b3d
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue