From 61c263856bbadd7f2527a4e2cd41b138cc9c30e7 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 15 Mar 2015 12:37:29 +0100 Subject: [PATCH] Giving a slightly more useful IPTorrent rss feed error. --- .../Indexers/IPTorrents/IPTorrentsSettings.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs index ca19effc0..08695eecc 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs @@ -1,6 +1,8 @@ using System; +using System.Text.RegularExpressions; using FluentValidation; using FluentValidation.Results; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Annotations; using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; @@ -12,7 +14,12 @@ namespace NzbDrone.Core.Indexers.IPTorrents public IPTorrentsSettingsValidator() { 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\?.+$")); } }