mirror of https://github.com/lidarr/Lidarr
21 lines
526 B
C#
21 lines
526 B
C#
using FluentValidation.Validators;
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
namespace NzbDrone.Core.Validation
|
|
{
|
|
public class FolderValidator : PropertyValidator
|
|
{
|
|
protected override string GetDefaultMessageTemplate() => "Invalid Path";
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
{
|
|
if (context.PropertyValue == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return context.PropertyValue.ToString().IsPathValid();
|
|
}
|
|
}
|
|
}
|