GetEpisodesByParseResult will properly handle Daily episodes.

This commit is contained in:
Mark McDowall 2011-11-24 00:28:20 -08:00
commit 38790e9f9c
3 changed files with 106 additions and 0 deletions

View file

@ -125,6 +125,30 @@ namespace NzbDrone.Core.Providers
{
var result = new List<Episode>();
if (parseResult.AirDate.HasValue)
{
var episodeInfo = GetEpisode(parseResult.Series.SeriesId, parseResult.AirDate.Value);
//if still null we should add the temp episode
if (episodeInfo == null && autoAddNew)
{
Logger.Debug("Episode {0} doesn't exist in db. adding it now.", parseResult);
episodeInfo = new Episode
{
SeriesId = parseResult.Series.SeriesId,
AirDate = parseResult.AirDate.Value,
Title = "TBD",
Overview = String.Empty,
};
AddEpisode(episodeInfo);
}
//Add to Result and Return (There will only be one episode to return)
result.Add(episodeInfo);
return result;
}
if (parseResult.EpisodeNumbers == null)
return result;