1
0
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:
Mark McDowall
2015-04-15 23:50:19 -07:00
parent c43296ffe9
commit c12f16b6d3
5 changed files with 65 additions and 6 deletions
@@ -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);
}