2023-03-13 06:41:35 +00:00
|
|
|
using FluentValidation;
|
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
using NzbDrone.Core.Validation;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.ImportLists.Rss.Plex
|
|
|
|
{
|
|
|
|
public class PlexRssImportSettingsValidator : AbstractValidator<PlexRssImportSettings>
|
|
|
|
{
|
|
|
|
public PlexRssImportSettingsValidator()
|
|
|
|
{
|
|
|
|
RuleFor(c => c.Url).NotEmpty();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-14 04:16:26 +00:00
|
|
|
public class PlexRssImportSettings : RssImportBaseSettings<PlexRssImportSettings>
|
2023-03-13 06:41:35 +00:00
|
|
|
{
|
2024-04-14 04:16:26 +00:00
|
|
|
private static readonly PlexRssImportSettingsValidator Validator = new ();
|
2023-03-13 06:41:35 +00:00
|
|
|
|
|
|
|
[FieldDefinition(0, Label = "Url", Type = FieldType.Textbox, HelpLink = "https://app.plex.tv/desktop/#!/settings/watchlist")]
|
|
|
|
public override string Url { get; set; }
|
|
|
|
|
|
|
|
public override NzbDroneValidationResult Validate()
|
|
|
|
{
|
|
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|