1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02: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 @@ public void processSearchResults_should_skip_if_series_is_null()
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All() .All()
.With(e => e.AirDate = DateTime.Today) .With(e => e.AirDate = DateTime.Today)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithNullSeries(); WithNullSeries();
@ -167,6 +168,7 @@ public void processSearchResults_should_skip_if_series_is_mismatched()
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All() .All()
.With(e => e.AirDate = DateTime.Today) .With(e => e.AirDate = DateTime.Today)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMisMatchedSeries(); WithMisMatchedSeries();
@ -242,6 +244,7 @@ public void processSearchResults_should_skip_if_parseResult_does_not_have_airdat
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All() .All()
.With(e => e.AirDate = null) .With(e => e.AirDate = null)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMatchingSeries(); WithMatchingSeries();
@ -262,6 +265,7 @@ public void processSearchResults_should_skip_if_parseResult_airdate_does_not_mat
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5) var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All() .All()
.With(e => e.AirDate = DateTime.Today.AddDays(10)) .With(e => e.AirDate = DateTime.Today.AddDays(10))
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMatchingSeries(); WithMatchingSeries();

View File

@ -183,6 +183,7 @@ public void processSearchResults_should_skip_if_series_is_null()
.All() .All()
.With(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 }) .With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithNullSeries(); WithNullSeries();
@ -205,6 +206,7 @@ public void processSearchResults_should_skip_if_series_is_mismatched()
.All() .All()
.With(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 }) .With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMisMatchedSeries(); WithMisMatchedSeries();
@ -227,6 +229,7 @@ public void processSearchResults_should_skip_if_season_doesnt_match()
.All() .All()
.With(e => e.SeasonNumber = 2) .With(e => e.SeasonNumber = 2)
.With(e => e.EpisodeNumbers = new List<int> { 1 }) .With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMatchingSeries(); WithMatchingSeries();
@ -249,6 +252,7 @@ public void processSearchResults_should_skip_if_episodeNumber_doesnt_match()
.All() .All()
.With(e => e.SeasonNumber = 1) .With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 2 }) .With(e => e.EpisodeNumbers = new List<int> { 2 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.Build(); .Build();
WithMatchingSeries(); WithMatchingSeries();

View File

@ -236,8 +236,11 @@ public EpisodeParseResult ParseFeed(SyndicationItem item)
var title = TitlePreParser(item); var title = TitlePreParser(item);
var episodeParseResult = Parser.ParseTitle(title); var episodeParseResult = Parser.ParseTitle(title);
if (episodeParseResult != null)
{
episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days;
episodeParseResult.OriginalString = title; episodeParseResult.OriginalString = title;
if (episodeParseResult != null) episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days; }
_logger.Trace("Parsed: {0} from: {1}", episodeParseResult, item.Title.Text); _logger.Trace("Parsed: {0} from: {1}", episodeParseResult, item.Title.Text);