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.
35 lines
948 B
35 lines
948 B
using FluentValidation;
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.ImportLists.LidarrLists
|
|
{
|
|
public class LidarrListsSettingsValidator : AbstractValidator<LidarrListsSettings>
|
|
{
|
|
public LidarrListsSettingsValidator()
|
|
{
|
|
RuleFor(c => c.BaseUrl).ValidRootUrl();
|
|
}
|
|
}
|
|
|
|
public class LidarrListsSettings : IImportListSettings
|
|
{
|
|
private static readonly LidarrListsSettingsValidator Validator = new LidarrListsSettingsValidator();
|
|
|
|
public LidarrListsSettings()
|
|
{
|
|
BaseUrl = "https://api.lidarr.audio/api/v0.3/chart/";
|
|
}
|
|
|
|
public string BaseUrl { get; set; }
|
|
|
|
[FieldDefinition(0, Label = "List Id")]
|
|
public string ListId { get; set; }
|
|
|
|
public NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|