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.
Lidarr/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs

35 lines
866 B

using System;
using FluentValidation;
using FluentValidation.Results;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Nyaa
{
public class NyaaSettingsValidator : AbstractValidator<NyaaSettings>
{
public NyaaSettingsValidator()
{
RuleFor(c => c.BaseUrl).ValidRootUrl();
}
}
public class NyaaSettings : IProviderConfig
{
private static readonly NyaaSettingsValidator validator = new NyaaSettingsValidator();
public NyaaSettings()
{
BaseUrl = "http://www.nyaa.se";
}
[FieldDefinition(0, Label = "Website URL")]
public String BaseUrl { get; set; }
public ValidationResult Validate()
{
return validator.Validate(this);
}
}
}