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.
32 lines
1.1 KiB
32 lines
1.1 KiB
using FluentValidation;
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.ImportLists.Trakt.List
|
|
{
|
|
public class TraktListSettingsValidator : TraktSettingsBaseValidator<TraktListSettings>
|
|
{
|
|
public TraktListSettingsValidator()
|
|
{
|
|
RuleFor(c => c.Username).NotEmpty();
|
|
RuleFor(c => c.Listname).NotEmpty();
|
|
}
|
|
}
|
|
|
|
public class TraktListSettings : TraktSettingsBase<TraktListSettings>
|
|
{
|
|
private static readonly TraktListSettingsValidator Validator = new ();
|
|
|
|
[FieldDefinition(1, Label = "Username", Privacy = PrivacyLevel.UserName, HelpText = "Username for the List to import from")]
|
|
public string Username { get; set; }
|
|
|
|
[FieldDefinition(2, Label = "List Name", HelpText = "List name for import, list must be public or you must have access to the list")]
|
|
public string Listname { get; set; }
|
|
|
|
public override NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|