You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
842 B
28 lines
842 B
using FluentValidation;
|
|
using NzbDrone.Api.Validation;
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
namespace NzbDrone.Api.Config
|
|
{
|
|
public class IndexerConfigModule : NzbDroneConfigModule<IndexerConfigResource>
|
|
{
|
|
|
|
public IndexerConfigModule(IConfigService configService)
|
|
: base(configService)
|
|
{
|
|
SharedValidator.RuleFor(c => c.MinimumAge)
|
|
.GreaterThanOrEqualTo(0);
|
|
|
|
SharedValidator.RuleFor(c => c.Retention)
|
|
.GreaterThanOrEqualTo(0);
|
|
|
|
SharedValidator.RuleFor(c => c.RssSyncInterval)
|
|
.IsValidRssSyncInterval();
|
|
}
|
|
|
|
protected override IndexerConfigResource ToResource(IConfigService model)
|
|
{
|
|
return IndexerConfigResourceMapper.ToResource(model);
|
|
}
|
|
}
|
|
} |