From bf34b4309402ce529a8c04de70f44b28948761f4 Mon Sep 17 00:00:00 2001 From: Stevie Robinson Date: Tue, 10 Jun 2025 02:12:04 +0200 Subject: [PATCH] Fixed validation for Remote Path Mapping --- .../RemotePathMappings/RemotePathMappingController.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Sonarr.Api.V3/RemotePathMappings/RemotePathMappingController.cs b/src/Sonarr.Api.V3/RemotePathMappings/RemotePathMappingController.cs index 2ae87aa4f..a2205f81e 100644 --- a/src/Sonarr.Api.V3/RemotePathMappings/RemotePathMappingController.cs +++ b/src/Sonarr.Api.V3/RemotePathMappings/RemotePathMappingController.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc; using NzbDrone.Common.Extensions; using NzbDrone.Core.RemotePathMappings; -using NzbDrone.Core.Validation; using NzbDrone.Core.Validation.Paths; using Sonarr.Http; using Sonarr.Http.REST; @@ -30,13 +29,12 @@ public RemotePathMappingController(IRemotePathMappingService remotePathMappingSe .NotEmpty(); SharedValidator.RuleFor(c => c.RemotePath) - .Must(remotePath => !remotePath.IsNotNullOrWhiteSpace() && !remotePath.StartsWith(" ")) - .WithMessage("Remote Path must not start with a space"); + .Must(remotePath => remotePath.IsNotNullOrWhiteSpace() && !remotePath.StartsWith(" ")) + .WithMessage("Remote Path '{PropertyValue}' must not start with a space"); SharedValidator.RuleFor(c => c.RemotePath) - .Must(remotePath => !remotePath.IsNotNullOrWhiteSpace() && !remotePath.EndsWith(" ")) - .WithMessage("Remote Path probably should not end with a space") - .AsWarning(); + .Must(remotePath => remotePath.IsNotNullOrWhiteSpace() && !remotePath.EndsWith(" ")) + .WithMessage("Remote Path '{PropertyValue}' must not end with a space"); SharedValidator.RuleFor(c => c.LocalPath) .Cascade(CascadeMode.Stop)