1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-28 23:07:13 -04:00

New: Improve validation messages

(cherry picked from commit a117001de673e80abd90d54a34a7c86292b3a649)
This commit is contained in:
Bogdan
2023-05-20 22:22:04 +03:00
parent aa794bddab
commit 933c23ce57
14 changed files with 43 additions and 19 deletions
@@ -6,7 +6,7 @@ namespace NzbDrone.Core.Validation
{
public class FolderValidator : PropertyValidator
{
protected override string GetDefaultMessageTemplate() => "Invalid Path";
protected override string GetDefaultMessageTemplate() => "Invalid Path: '{path}'";
protected override bool IsValid(PropertyValidatorContext context)
{
@@ -15,6 +15,8 @@ namespace NzbDrone.Core.Validation
return false;
}
context.MessageFormatter.AppendArgument("path", context.PropertyValue.ToString());
return context.PropertyValue.ToString().IsPathValid(PathValidationType.CurrentOs);
}
}