1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -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
@@ -12,7 +12,7 @@ namespace NzbDrone.Core.Validation.Paths
_diskProvider = diskProvider;
}
protected override string GetDefaultMessageTemplate() => "File does not exist";
protected override string GetDefaultMessageTemplate() => "File '{file}' does not exist";
protected override bool IsValid(PropertyValidatorContext context)
{
@@ -21,6 +21,8 @@ namespace NzbDrone.Core.Validation.Paths
return false;
}
context.MessageFormatter.AppendArgument("file", context.PropertyValue.ToString());
return _diskProvider.FileExists(context.PropertyValue.ToString());
}
}