1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 07:22:35 +01:00

Nzbx download URL fixed

Fixed: Nzbx download URL formatted correctly
This commit is contained in:
Mark McDowall 2013-01-16 22:47:57 -08:00
parent 7d82c249f9
commit e17ed8c0ad
2 changed files with 17 additions and 1 deletions

View File

@ -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<HttpProvider>()
.Setup(h => h.DownloadString("https://nzbx.co/api/recent?category=tv", It.IsAny<NetworkCredential>()))
.Returns(File.ReadAllText(".\\Files\\Rss\\SizeParsing\\nzbx_recent.json"));
//Act
var parseResults = Mocker.Resolve<Nzbx>().FetchRss();
parseResults.Should().HaveCount(1);
parseResults[0].NzbUrl.Should().EndWith(parseResults[0].OriginalString);
}
}
}

View File

@ -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;