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.
34 lines
905 B
34 lines
905 B
using FluentValidation;
|
|
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.ImportLists.Custom
|
|
{
|
|
public class CustomSettingsValidator : AbstractValidator<CustomSettings>
|
|
{
|
|
public CustomSettingsValidator()
|
|
{
|
|
RuleFor(c => c.BaseUrl).ValidRootUrl();
|
|
}
|
|
}
|
|
|
|
public class CustomSettings : IImportListSettings
|
|
{
|
|
private static readonly CustomSettingsValidator Validator = new CustomSettingsValidator();
|
|
|
|
public CustomSettings()
|
|
{
|
|
BaseUrl = "";
|
|
}
|
|
|
|
[FieldDefinition(0, Label = "ImportListsCustomListSettingsUrl", HelpText = "ImportListsCustomListSettingsUrlHelpText")]
|
|
public string BaseUrl { get; set; }
|
|
|
|
public NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|