mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
New: Additional Path Validation on Movie Add
This commit is contained in:
parent
fd3acd85e6
commit
5128481b23
@ -35,6 +35,7 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
|||||||
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 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
|||||||
.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 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
|||||||
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);
|
||||||
|
|
||||||
|
@ -40,9 +40,11 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
|||||||
IManageCommandQueue commandQueueManager,
|
IManageCommandQueue commandQueueManager,
|
||||||
IUpgradableSpecification qualityUpgradableSpecification,
|
IUpgradableSpecification qualityUpgradableSpecification,
|
||||||
RootFolderValidator rootFolderValidator,
|
RootFolderValidator rootFolderValidator,
|
||||||
|
MappedNetworkDriveValidator mappedNetworkDriveValidator,
|
||||||
MoviePathValidator moviesPathValidator,
|
MoviePathValidator moviesPathValidator,
|
||||||
MovieExistsValidator moviesExistsValidator,
|
MovieExistsValidator moviesExistsValidator,
|
||||||
MovieAncestorValidator moviesAncestorValidator,
|
MovieAncestorValidator moviesAncestorValidator,
|
||||||
|
SystemFolderValidator systemFolderValidator,
|
||||||
ProfileExistsValidator profileExistsValidator,
|
ProfileExistsValidator profileExistsValidator,
|
||||||
MovieFolderAsRootFolderValidator movieFolderAsRootFolderValidator)
|
MovieFolderAsRootFolderValidator movieFolderAsRootFolderValidator)
|
||||||
: base(signalRBroadcaster)
|
: base(signalRBroadcaster)
|
||||||
@ -64,8 +66,10 @@ public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
|||||||
.Cascade(CascadeMode.StopOnFirstFailure)
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
||||||
.IsValidPath()
|
.IsValidPath()
|
||||||
.SetValidator(rootFolderValidator)
|
.SetValidator(rootFolderValidator)
|
||||||
|
.SetValidator(mappedNetworkDriveValidator)
|
||||||
.SetValidator(moviesPathValidator)
|
.SetValidator(moviesPathValidator)
|
||||||
.SetValidator(moviesAncestorValidator)
|
.SetValidator(moviesAncestorValidator)
|
||||||
|
.SetValidator(systemFolderValidator)
|
||||||
.When(s => !s.Path.IsNullOrWhiteSpace());
|
.When(s => !s.Path.IsNullOrWhiteSpace());
|
||||||
|
|
||||||
SharedValidator.RuleFor(s => s.QualityProfileId).SetValidator(profileExistsValidator);
|
SharedValidator.RuleFor(s => s.QualityProfileId).SetValidator(profileExistsValidator);
|
||||||
|
Loading…
Reference in New Issue
Block a user