mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
@@ -3,7 +3,6 @@ using FluentValidation;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.RemotePathMappings;
|
using NzbDrone.Core.RemotePathMappings;
|
||||||
using NzbDrone.Core.Validation;
|
|
||||||
using NzbDrone.Core.Validation.Paths;
|
using NzbDrone.Core.Validation.Paths;
|
||||||
using Radarr.Http;
|
using Radarr.Http;
|
||||||
using Radarr.Http.REST;
|
using Radarr.Http.REST;
|
||||||
@@ -30,13 +29,12 @@ namespace Radarr.Api.V3.RemotePathMappings
|
|||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.RemotePath)
|
SharedValidator.RuleFor(c => c.RemotePath)
|
||||||
.Must(remotePath => !remotePath.IsNotNullOrWhiteSpace() && !remotePath.StartsWith(" "))
|
.Must(remotePath => remotePath.IsNotNullOrWhiteSpace() && !remotePath.StartsWith(" "))
|
||||||
.WithMessage("Remote Path must not start with a space");
|
.WithMessage("Remote Path '{PropertyValue}' must not start with a space");
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.RemotePath)
|
SharedValidator.RuleFor(c => c.RemotePath)
|
||||||
.Must(remotePath => !remotePath.IsNotNullOrWhiteSpace() && !remotePath.EndsWith(" "))
|
.Must(remotePath => remotePath.IsNotNullOrWhiteSpace() && !remotePath.EndsWith(" "))
|
||||||
.WithMessage("Remote Path probably should not end with a space")
|
.WithMessage("Remote Path '{PropertyValue}' must not end with a space");
|
||||||
.AsWarning();
|
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.LocalPath)
|
SharedValidator.RuleFor(c => c.LocalPath)
|
||||||
.Cascade(CascadeMode.Stop)
|
.Cascade(CascadeMode.Stop)
|
||||||
|
|||||||
Reference in New Issue
Block a user