mirror of https://github.com/Radarr/Radarr
34 lines
974 B
C#
34 lines
974 B
C#
![]() |
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));
|
||
|
}
|
||
|
}
|
||
|
}
|