From 724e354eee2a757437bced41c4e00eeed2689240 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 23 Apr 2012 12:33:16 -0700 Subject: [PATCH] Fixed bug with RSS Item TIitle. Fixed broken tests. --- .../ProcessDailySearchResultsFixture.cs | 4 ++++ .../SearchProviderTests/ProcessSearchResultsFixture.cs | 4 ++++ NzbDrone.Core/Providers/Indexer/IndexerBase.cs | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs index 5c1f6dfb3..a1dbf2041 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs @@ -147,6 +147,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithNullSeries(); @@ -167,6 +168,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMisMatchedSeries(); @@ -242,6 +244,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = null) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMatchingSeries(); @@ -262,6 +265,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today.AddDays(10)) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMatchingSeries(); diff --git a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs index 145c8301a..a3ddf644f 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs @@ -183,6 +183,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 1 }) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithNullSeries(); @@ -205,6 +206,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 1 }) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMisMatchedSeries(); @@ -227,6 +229,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .All() .With(e => e.SeasonNumber = 2) .With(e => e.EpisodeNumbers = new List { 1 }) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMatchingSeries(); @@ -249,6 +252,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 2 }) + .With(e => e.Quality = new Quality(QualityTypes.HDTV, false)) .Build(); WithMatchingSeries(); diff --git a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs index d105e7a3e..af9bf25aa 100644 --- a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs +++ b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs @@ -236,8 +236,11 @@ namespace NzbDrone.Core.Providers.Indexer var title = TitlePreParser(item); var episodeParseResult = Parser.ParseTitle(title); - episodeParseResult.OriginalString = title; - if (episodeParseResult != null) episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days; + if (episodeParseResult != null) + { + episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days; + episodeParseResult.OriginalString = title; + } _logger.Trace("Parsed: {0} from: {1}", episodeParseResult, item.Title.Text);