mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-19 21:46:43 -04:00
Mapped Network Drive Validator
New: Prevent adding Mapped Network Drives when Running as a Windows Services
This commit is contained in:
@@ -11,7 +11,9 @@ namespace NzbDrone.Api.RemotePathMappings
|
||||
{
|
||||
private readonly IRemotePathMappingService _remotePathMappingService;
|
||||
|
||||
public RemotePathMappingModule(IRemotePathMappingService remotePathMappingService, PathExistsValidator pathExistsValidator)
|
||||
public RemotePathMappingModule(IRemotePathMappingService remotePathMappingService,
|
||||
PathExistsValidator pathExistsValidator,
|
||||
MappedNetworkDriveValidator mappedNetworkDriveValidator)
|
||||
{
|
||||
_remotePathMappingService = remotePathMappingService;
|
||||
|
||||
@@ -31,6 +33,7 @@ namespace NzbDrone.Api.RemotePathMappings
|
||||
SharedValidator.RuleFor(c => c.LocalPath)
|
||||
.Cascade(CascadeMode.StopOnFirstFailure)
|
||||
.IsValidPath()
|
||||
.SetValidator(mappedNetworkDriveValidator)
|
||||
.SetValidator(pathExistsValidator);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user