|
|
@ -35,6 +35,7 @@ namespace NzbDrone.Api.Movies
|
|
|
|
IMovieService moviesService,
|
|
|
|
IMovieService moviesService,
|
|
|
|
IMapCoversToLocal coverMapper,
|
|
|
|
IMapCoversToLocal coverMapper,
|
|
|
|
RootFolderValidator rootFolderValidator,
|
|
|
|
RootFolderValidator rootFolderValidator,
|
|
|
|
|
|
|
|
MappedNetworkDriveValidator mappedNetworkDriveValidator,
|
|
|
|
MoviePathValidator moviesPathValidator,
|
|
|
|
MoviePathValidator moviesPathValidator,
|
|
|
|
MovieExistsValidator moviesExistsValidator,
|
|
|
|
MovieExistsValidator moviesExistsValidator,
|
|
|
|
MovieAncestorValidator moviesAncestorValidator,
|
|
|
|
MovieAncestorValidator moviesAncestorValidator,
|
|
|
@ -59,6 +60,7 @@ namespace NzbDrone.Api.Movies
|
|
|
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
|
|
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
|
|
|
.IsValidPath()
|
|
|
|
.IsValidPath()
|
|
|
|
.SetValidator(rootFolderValidator)
|
|
|
|
.SetValidator(rootFolderValidator)
|
|
|
|
|
|
|
|
.SetValidator(mappedNetworkDriveValidator)
|
|
|
|
.SetValidator(moviesPathValidator)
|
|
|
|
.SetValidator(moviesPathValidator)
|
|
|
|
.SetValidator(moviesAncestorValidator)
|
|
|
|
.SetValidator(moviesAncestorValidator)
|
|
|
|
.SetValidator(systemFolderValidator)
|
|
|
|
.SetValidator(systemFolderValidator)
|
|
|
@ -67,7 +69,9 @@ namespace NzbDrone.Api.Movies
|
|
|
|
SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator);
|
|
|
|
SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator);
|
|
|
|
|
|
|
|
|
|
|
|
PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
|
|
|
|
PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
|
|
|
|
PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace());
|
|
|
|
PostValidator.RuleFor(s => s.RootFolderPath)
|
|
|
|
|
|
|
|
.IsValidPath()
|
|
|
|
|
|
|
|
.When(s => s.Path.IsNullOrWhiteSpace());
|
|
|
|
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
|
|
|
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
|
|
|
PostValidator.RuleFor(s => s.TmdbId).NotNull().NotEmpty().SetValidator(moviesExistsValidator);
|
|
|
|
PostValidator.RuleFor(s => s.TmdbId).NotNull().NotEmpty().SetValidator(moviesExistsValidator);
|
|
|
|
|
|
|
|
|
|
|
|