|
|
|
@ -70,6 +70,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
|
RecycleBinValidator recycleBinValidator,
|
|
|
|
|
SystemFolderValidator systemFolderValidator,
|
|
|
|
|
QualityProfileExistsValidator qualityProfileExistsValidator,
|
|
|
|
|
RootFolderExistsValidator rootFolderExistsValidator,
|
|
|
|
|
MovieFolderAsRootFolderValidator movieFolderAsRootFolderValidator,
|
|
|
|
|
Logger logger)
|
|
|
|
|
: base(signalRBroadcaster)
|
|
|
|
@ -103,6 +104,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
|
PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
|
|
|
|
|
PostValidator.RuleFor(s => s.RootFolderPath)
|
|
|
|
|
.IsValidPath()
|
|
|
|
|
.SetValidator(rootFolderExistsValidator)
|
|
|
|
|
.SetValidator(movieFolderAsRootFolderValidator)
|
|
|
|
|
.When(s => s.Path.IsNullOrWhiteSpace());
|
|
|
|
|
PostValidator.RuleFor(s => s.Title).NotEmpty().When(s => s.TmdbId <= 0);
|
|
|
|
@ -240,6 +242,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
|
|
|
|
|
|
[RestPostById]
|
|
|
|
|
[Consumes("application/json")]
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
public ActionResult<MovieResource> AddMovie([FromBody] MovieResource moviesResource)
|
|
|
|
|
{
|
|
|
|
|
var movie = _addMovieService.AddMovie(moviesResource.ToModel());
|
|
|
|
@ -249,6 +252,7 @@ namespace Radarr.Api.V3.Movies
|
|
|
|
|
|
|
|
|
|
[RestPutById]
|
|
|
|
|
[Consumes("application/json")]
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
public ActionResult<MovieResource> UpdateMovie([FromBody] MovieResource moviesResource, [FromQuery] bool moveFiles = false)
|
|
|
|
|
{
|
|
|
|
|
var movie = _moviesService.GetMovie(moviesResource.Id);
|
|
|
|
|