Radarr/src/Radarr.Http/Validation/NetImportSyncIntervalValida...

30 lines
639 B
C#
Raw Normal View History

2018-11-23 07:03:32 +00:00
using FluentValidation.Validators;
2018-11-23 07:03:32 +00:00
namespace Radarr.Http.Validation
{
public class ImportListSyncIntervalValidator : PropertyValidator
{
public ImportListSyncIntervalValidator()
: base("Must be greater than 6 hours")
{
}
protected override bool IsValid(PropertyValidatorContext context)
{
if (context.PropertyValue == null)
{
return true;
}
var value = (int)context.PropertyValue;
if (value >= 6)
{
return true;
}
return false;
}
}
}