mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
First implementation of History for Movies. However, nothing is returned from the Database query misteriously.
This commit is contained in:
@@ -3,6 +3,7 @@ using Nancy;
|
||||
using NzbDrone.Api.Episodes;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Api.Series;
|
||||
using NzbDrone.Api.Movie;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.Download;
|
||||
@@ -34,12 +35,18 @@ namespace NzbDrone.Api.History
|
||||
|
||||
resource.Series = model.Series.ToResource();
|
||||
resource.Episode = model.Episode.ToResource();
|
||||
resource.Movie = model.Movie.ToResource();
|
||||
|
||||
if (model.Series != null)
|
||||
{
|
||||
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Series.Profile.Value, model.Quality);
|
||||
}
|
||||
|
||||
if (model.Movie != null)
|
||||
{
|
||||
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Movie.Profile.Value, model.Quality);
|
||||
}
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
@@ -47,6 +54,8 @@ namespace NzbDrone.Api.History
|
||||
{
|
||||
var episodeId = Request.Query.EpisodeId;
|
||||
|
||||
var movieId = Request.Query.MovieId;
|
||||
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending);
|
||||
|
||||
if (pagingResource.FilterKey == "eventType")
|
||||
@@ -61,6 +70,14 @@ namespace NzbDrone.Api.History
|
||||
pagingSpec.FilterExpression = h => h.EpisodeId == i;
|
||||
}
|
||||
|
||||
if (movieId.HasValue)
|
||||
{
|
||||
int i = (int)movieId;
|
||||
pagingSpec.FilterExpression = h => h.MovieId == i;
|
||||
}
|
||||
|
||||
var pg = _historyService.Paged(pagingSpec);
|
||||
|
||||
return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user