Radarr/src/NzbDrone.Core/Indexers/TorrentRssIndexer/TorrentRssIndexerSettings.cs

34 lines
974 B
C#
Raw Normal View History

using System;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.TorrentRssIndexer
{
public class TorrentRssIndexerSettingsValidator : AbstractValidator<TorrentRssIndexerSettings>
{
public TorrentRssIndexerSettingsValidator()
{
RuleFor(c => c.BaseUrl).ValidRootUrl();
}
}
public class TorrentRssIndexerSettings : IProviderConfig
{
private static readonly TorrentRssIndexerSettingsValidator validator = new TorrentRssIndexerSettingsValidator();
public TorrentRssIndexerSettings()
{
BaseUrl = string.Empty;
}
[FieldDefinition(0, Label = "Full RSS Feed URL")]
public String BaseUrl { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(validator.Validate(this));
}
}
}