mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Giving a slightly more useful IPTorrent rss feed error.
This commit is contained in:
parent
593c4b8182
commit
61c263856b
@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
using NzbDrone.Core.Validation;
|
using NzbDrone.Core.Validation;
|
||||||
@ -12,7 +14,12 @@ public class IPTorrentsSettingsValidator : AbstractValidator<IPTorrentsSettings>
|
|||||||
public IPTorrentsSettingsValidator()
|
public IPTorrentsSettingsValidator()
|
||||||
{
|
{
|
||||||
RuleFor(c => c.Url).ValidRootUrl();
|
RuleFor(c => c.Url).ValidRootUrl();
|
||||||
RuleFor(c => c.Url).Matches(@"/rss\?.+;download$");
|
|
||||||
|
RuleFor(c => c.Url).Matches(@"/rss\?.+$");
|
||||||
|
|
||||||
|
RuleFor(c => c.Url).Matches(@"/rss\?.+;download$")
|
||||||
|
.WithMessage("Use Direct Download Url")
|
||||||
|
.When(v => v.Url.IsNotNullOrWhiteSpace() && Regex.IsMatch(v.Url, @"/rss\?.+$"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user