mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Set CutoffUnmet correctly on MovieEditor response
This commit is contained in:
parent
f55e44c591
commit
a960716cec
@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using Nancy;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
using NzbDrone.Core.Movies;
|
||||
using NzbDrone.Core.Movies.Commands;
|
||||
@ -13,12 +14,14 @@ public class MovieEditorModule : RadarrV3Module
|
||||
{
|
||||
private readonly IMovieService _movieService;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly IUpgradableSpecification _upgradableSpecification;
|
||||
|
||||
public MovieEditorModule(IMovieService movieService, IManageCommandQueue commandQueueManager)
|
||||
public MovieEditorModule(IMovieService movieService, IManageCommandQueue commandQueueManager, IUpgradableSpecification upgradableSpecification)
|
||||
: base("/movie/editor")
|
||||
{
|
||||
_movieService = movieService;
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_upgradableSpecification = upgradableSpecification;
|
||||
Put("/", movie => SaveAll());
|
||||
Delete("/", movie => DeleteMovies());
|
||||
}
|
||||
@ -86,7 +89,7 @@ private object SaveAll()
|
||||
}
|
||||
|
||||
return ResponseWithCode(_movieService.UpdateMovie(moviesToUpdate, !resource.MoveFiles)
|
||||
.ToResource(0),
|
||||
.ToResource(0, _upgradableSpecification),
|
||||
HttpStatusCode.Accepted);
|
||||
}
|
||||
|
||||
|
@ -196,9 +196,9 @@ public static Movie ToModel(this MovieResource resource, Movie movie)
|
||||
return movie;
|
||||
}
|
||||
|
||||
public static List<MovieResource> ToResource(this IEnumerable<Movie> movies, int availDelay)
|
||||
public static List<MovieResource> ToResource(this IEnumerable<Movie> movies, int availDelay, IUpgradableSpecification upgradableSpecification = null)
|
||||
{
|
||||
return movies.Select(x => ToResource(x, availDelay)).ToList();
|
||||
return movies.Select(x => ToResource(x, availDelay, null, upgradableSpecification)).ToList();
|
||||
}
|
||||
|
||||
public static List<Movie> ToModel(this IEnumerable<MovieResource> resources)
|
||||
|
Loading…
Reference in New Issue
Block a user