mirror of
https://github.com/Radarr/Radarr
synced 2025-12-24 09:13:45 +01:00
Fixed: Set CutoffUnmet correctly on MovieEditor response
This commit is contained in:
parent
f55e44c591
commit
a960716cec
2 changed files with 7 additions and 4 deletions
|
|
@ -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 a new issue