|
|
@ -100,12 +100,9 @@ namespace NzbDrone.Core.Tv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId);
|
|
|
|
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId) ??
|
|
|
|
|
|
|
|
seriesEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
|
|
|
|
|
|
|
|
|
|
|
|
if (episodeToUpdate == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (episodeToUpdate == null)
|
|
|
|
if (episodeToUpdate == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
episodeToUpdate = new Episode();
|
|
|
|
episodeToUpdate = new Episode();
|
|
|
@ -119,8 +116,7 @@ namespace NzbDrone.Core.Tv
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var season = seasons.FirstOrDefault(c => c.SeasonNumber == episode.SeasonNumber);
|
|
|
|
var season = seasons.FirstOrDefault(c => c.SeasonNumber == episode.SeasonNumber);
|
|
|
|
|
|
|
|
episodeToUpdate.Monitored = season == null || season.Monitored;
|
|
|
|
episodeToUpdate.Monitored = season != null ? season.Monitored : true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -148,7 +144,7 @@ namespace NzbDrone.Core.Tv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.FatalException(String.Format("An error has occurred while updating episode info for series {0}", series), e);
|
|
|
|
_logger.FatalException(String.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode), e);
|
|
|
|
failCount++;
|
|
|
|
failCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|