diff --git a/NzbDrone.Api/Indexers/ReleaseModule.cs b/NzbDrone.Api/Indexers/ReleaseModule.cs index 6e68124fa..a824d0200 100644 --- a/NzbDrone.Api/Indexers/ReleaseModule.cs +++ b/NzbDrone.Api/Indexers/ReleaseModule.cs @@ -42,7 +42,7 @@ private List GetEpisodeReleases(int episodeId) private List GetRss() { - if (results == null) + //if (results == null) { var reports = _rssFetcherAndParser.Fetch(); var decisions = _downloadDecisionMaker.GetRssDecision(reports); diff --git a/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs b/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs index a244d89a8..eb18358f2 100644 --- a/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs +++ b/NzbDrone.Core.Test/IndexerTests/IntegrationTests/IndexerIntegrationTests.cs @@ -4,6 +4,7 @@ using NzbDrone.Core.Indexers.Newznab; using NzbDrone.Core.Indexers.NzbClub; using NzbDrone.Core.Indexers.Nzbx; +using NzbDrone.Core.Indexers.Wombles; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Test.Framework; using NUnit.Framework; @@ -18,7 +19,7 @@ public class IndexerIntegrationTests : CoreTest public void SetUp() { UseRealHttp(); - + } [Test] @@ -43,6 +44,17 @@ public void nzbx_rss() + [Test] + public void wombles_rss() + { + var indexer = new Wombles(); + + var result = Subject.FetchRss(indexer); + + ValidateResult(result, skipSize: true, skipInfo: true); + } + + [Test] [Explicit("needs newznab api key")] public void nzbsorg_rss() @@ -58,25 +70,26 @@ public void nzbsorg_rss() var result = Subject.FetchRss(indexer); - result.Should().NotBeEmpty(); - result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title)); - result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl)); - - //TODO: uncomment these after moving to restsharp for rss - //result.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl)); - //result.Should().OnlyContain(c => c.Size > 0); - + ValidateResult(result); } - private void ValidateResult(IList reports) + private void ValidateResult(IList reports, bool skipSize = false, bool skipInfo = false) { reports.Should().NotBeEmpty(); reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.Title)); - reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl)); reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbUrl)); - reports.Should().OnlyContain(c => c.Size > 0); + + if (!skipInfo) + { + reports.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.NzbInfoUrl)); + } + + if (!skipSize) + { + reports.Should().OnlyContain(c => c.Size > 0); + } } } diff --git a/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 2ad2236cb..89aeb7c27 100644 --- a/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -7,7 +7,13 @@ namespace NzbDrone.Core.Indexers.Newznab { public class Newznab : IndexerWithSetting { - + public override IParseFeed Parser + { + get + { + return new NewznabParser(this); + } + } public override IEnumerable DefaultDefinitions { diff --git a/NzbDrone.Core/Indexers/Wombles/Wombles.cs b/NzbDrone.Core/Indexers/Wombles/Wombles.cs index bf699be14..dbc460124 100644 --- a/NzbDrone.Core/Indexers/Wombles/Wombles.cs +++ b/NzbDrone.Core/Indexers/Wombles/Wombles.cs @@ -5,9 +5,17 @@ namespace NzbDrone.Core.Indexers.Wombles { public class Wombles : IndexerBase { + public override IParseFeed Parser + { + get + { + return new WomblesParser(); + } + } + public override IEnumerable RecentFeed { - get { yield return string.Format("http://nzb.isasecret.com/rss"); } + get { yield return "http://nzb.isasecret.com/rss/?sec=TV&fr=false"; } } public override string Name