1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +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 @@ public void processSearchResults_should_skip_if_series_is_null()
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 @@ public void processSearchResults_should_skip_if_series_is_mismatched()
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 @@ public void processSearchResults_should_skip_if_parseResult_does_not_have_airdat
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 @@ public void processSearchResults_should_skip_if_parseResult_airdate_does_not_mat
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 @@ public void processSearchResults_should_skip_if_series_is_null()
.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 @@ public void processSearchResults_should_skip_if_series_is_mismatched()
.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 @@ public void processSearchResults_should_skip_if_season_doesnt_match()
.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 @@ public void processSearchResults_should_skip_if_episodeNumber_doesnt_match()
.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 @@ public EpisodeParseResult ParseFeed(SyndicationItem item)
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);