From e17ed8c0ad177e7daf614758d8d6b8ac0fe74966 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 16 Jan 2013 22:47:57 -0800 Subject: [PATCH] Nzbx download URL fixed Fixed: Nzbx download URL formatted correctly --- NzbDrone.Core.Test/IndexerTests/NzbxFixture.cs | 14 ++++++++++++++ NzbDrone.Core/Providers/Indexer/Nzbx.cs | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core.Test/IndexerTests/NzbxFixture.cs b/NzbDrone.Core.Test/IndexerTests/NzbxFixture.cs index 683e38c27..3f4f836cd 100644 --- a/NzbDrone.Core.Test/IndexerTests/NzbxFixture.cs +++ b/NzbDrone.Core.Test/IndexerTests/NzbxFixture.cs @@ -115,5 +115,19 @@ namespace NzbDrone.Core.Test.IndexerTests parseResults.Should().HaveCount(1); parseResults[0].Age.Should().Be(expectedAge); } + + [Test] + public void should_name_nzb_properly() + { + Mocker.GetMock() + .Setup(h => h.DownloadString("https://nzbx.co/api/recent?category=tv", It.IsAny())) + .Returns(File.ReadAllText(".\\Files\\Rss\\SizeParsing\\nzbx_recent.json")); + + //Act + var parseResults = Mocker.Resolve().FetchRss(); + + parseResults.Should().HaveCount(1); + parseResults[0].NzbUrl.Should().EndWith(parseResults[0].OriginalString); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/Indexer/Nzbx.cs b/NzbDrone.Core/Providers/Indexer/Nzbx.cs index f4972cca5..5604808ac 100644 --- a/NzbDrone.Core/Providers/Indexer/Nzbx.cs +++ b/NzbDrone.Core/Providers/Indexer/Nzbx.cs @@ -127,7 +127,8 @@ namespace NzbDrone.Core.Providers.Indexer episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PostDate).Days; episodeParseResult.OriginalString = item.Name; episodeParseResult.SceneSource = true; - episodeParseResult.NzbUrl = String.Format("http://nzbx.co/nzb?{0}", item.Guid); + episodeParseResult.NzbUrl = String.Format("http://nzbx.co/nzb?{0}*|*{1}", item.Guid, item.Name); + episodeParseResult.NzbInfoUrl = String.Format("http://nzbx.co/d?{0}", item.Guid); episodeParseResult.Indexer = Name; episodeParseResult.Size = item.Size; @@ -178,6 +179,7 @@ namespace NzbDrone.Core.Providers.Indexer episodeParseResult.OriginalString = item.Name; episodeParseResult.SceneSource = true; episodeParseResult.NzbUrl = item.Nzb; + episodeParseResult.NzbInfoUrl = String.Format("http://nzbx.co/d?{0}", item.Guid); episodeParseResult.Indexer = Name; episodeParseResult.Size = item.Size;