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.
Radarr/src/NzbDrone.Core/ImportLists/RSSImport/RSSImportSettings.cs

33 lines
915 B

using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.ImportLists.RSSImport
{
public class RSSImportSettingsValidator : AbstractValidator<RSSImportSettings>
{
public RSSImportSettingsValidator()
{
RuleFor(c => c.Link).ValidRootUrl();
}
}
public class RSSImportSettings : ImportListSettingsBase<RSSImportSettings>
{
private static readonly RSSImportSettingsValidator Validator = new ();
public RSSImportSettings()
{
Link = "https://rss.yoursite.com";
}
[FieldDefinition(0, Label = "RSS Link", HelpText = "Link to the rss feed of movies.")]
public string Link { get; set; }
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}