Fixed: Set CutoffUnmet correctly on MovieEditor response

pull/5416/head
Qstick 4 years ago
parent f55e44c591
commit a960716cec

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Nancy; using Nancy;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Commands; using NzbDrone.Core.Movies.Commands;
@ -13,12 +14,14 @@ namespace Radarr.Api.V3.Movies
{ {
private readonly IMovieService _movieService; private readonly IMovieService _movieService;
private readonly IManageCommandQueue _commandQueueManager; 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") : base("/movie/editor")
{ {
_movieService = movieService; _movieService = movieService;
_commandQueueManager = commandQueueManager; _commandQueueManager = commandQueueManager;
_upgradableSpecification = upgradableSpecification;
Put("/", movie => SaveAll()); Put("/", movie => SaveAll());
Delete("/", movie => DeleteMovies()); Delete("/", movie => DeleteMovies());
} }
@ -86,7 +89,7 @@ namespace Radarr.Api.V3.Movies
} }
return ResponseWithCode(_movieService.UpdateMovie(moviesToUpdate, !resource.MoveFiles) return ResponseWithCode(_movieService.UpdateMovie(moviesToUpdate, !resource.MoveFiles)
.ToResource(0), .ToResource(0, _upgradableSpecification),
HttpStatusCode.Accepted); HttpStatusCode.Accepted);
} }

@ -196,9 +196,9 @@ namespace Radarr.Api.V3.Movies
return 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) public static List<Movie> ToModel(this IEnumerable<MovieResource> resources)

Loading…
Cancel
Save