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/ImportLists/Custom/CustomSettings.cs

34 lines
868 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 = "List URL", HelpText = "The URL for the artist list")]
public string BaseUrl { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}