2014-02-16 09:56:12 +00:00
|
|
|
|
using FluentValidation;
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Config
|
|
|
|
|
{
|
|
|
|
|
public class IndexerConfigModule : NzbDroneConfigModule<IndexerConfigResource>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public IndexerConfigModule(IConfigService configService)
|
|
|
|
|
: base(configService)
|
|
|
|
|
{
|
2014-12-15 23:40:53 +00:00
|
|
|
|
SharedValidator.RuleFor(c => c.MinimumAge)
|
2014-12-16 00:31:26 +00:00
|
|
|
|
.GreaterThanOrEqualTo(0);
|
2014-12-15 23:40:53 +00:00
|
|
|
|
|
|
|
|
|
SharedValidator.RuleFor(c => c.Retention)
|
|
|
|
|
.GreaterThanOrEqualTo(0);
|
|
|
|
|
|
2014-04-11 01:14:03 +00:00
|
|
|
|
SharedValidator.RuleFor(c => c.RssSyncInterval)
|
|
|
|
|
.InclusiveBetween(10, 120)
|
|
|
|
|
.When(c => c.RssSyncInterval > 0);
|
2014-02-16 09:56:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|