2018-12-07 10:21:43 +00:00
|
|
|
using FluentValidation;
|
2017-02-25 16:34:07 +00:00
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
|
|
|
using NzbDrone.Core.Validation;
|
2017-01-11 20:42:37 +00:00
|
|
|
|
2020-09-04 02:50:56 +00:00
|
|
|
namespace NzbDrone.Core.ImportLists.RSSImport
|
2017-01-11 20:42:37 +00:00
|
|
|
{
|
2017-02-25 16:34:07 +00:00
|
|
|
public class RSSImportSettingsValidator : AbstractValidator<RSSImportSettings>
|
|
|
|
{
|
|
|
|
public RSSImportSettingsValidator()
|
|
|
|
{
|
|
|
|
RuleFor(c => c.Link).ValidRootUrl();
|
|
|
|
}
|
|
|
|
}
|
2017-01-11 20:42:37 +00:00
|
|
|
|
2017-02-25 16:34:07 +00:00
|
|
|
public class RSSImportSettings : IProviderConfig
|
2017-01-11 20:42:37 +00:00
|
|
|
{
|
2017-02-25 16:34:07 +00:00
|
|
|
private static readonly RSSImportSettingsValidator Validator = new RSSImportSettingsValidator();
|
2017-01-11 20:42:37 +00:00
|
|
|
|
2017-01-21 19:29:31 +00:00
|
|
|
public RSSImportSettings()
|
2017-01-15 20:28:35 +00:00
|
|
|
{
|
2018-12-07 10:21:43 +00:00
|
|
|
Link = "https://rss.yoursite.com";
|
2017-01-15 20:28:35 +00:00
|
|
|
}
|
|
|
|
|
2017-01-21 17:42:58 +00:00
|
|
|
[FieldDefinition(0, Label = "RSS Link", HelpText = "Link to the rss feed of movies.")]
|
2017-02-25 16:34:07 +00:00
|
|
|
public string Link { get; set; }
|
|
|
|
|
|
|
|
public NzbDroneValidationResult Validate()
|
|
|
|
{
|
|
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
|
|
}
|
2017-01-11 20:42:37 +00:00
|
|
|
}
|
|
|
|
}
|