1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 01:06:30 +00:00

Fixed bug with RSS Item TIitle.

Fixed broken tests.
This commit is contained in:
Mark McDowall 2012-04-23 12:33:16 -07:00
parent 34e008f0c8
commit 724e354eee
3 changed files with 13 additions and 2 deletions

View file

@ -147,6 +147,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.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<EpisodeParseResult>.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<EpisodeParseResult>.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<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(e => e.AirDate = DateTime.Today.AddDays(10))
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();

View file

@ -183,6 +183,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 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<int> { 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<int> { 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<int> { 2 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();

View file

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