1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

EpisodeRefresh matches by season and episode number instead of tvdbepisodeid

This commit is contained in:
Mark McDowall 2013-08-03 22:45:46 -07:00
parent ab9c22f7c1
commit 7e4236df3e
2 changed files with 1 additions and 9 deletions

View File

@ -28,7 +28,6 @@ public RefreshEpisodeService(IEpisodeService episodeService,
_logger = logger; _logger = logger;
} }
public void RefreshEpisodeInfo(Series series, IEnumerable<Episode> remoteEpisodes) public void RefreshEpisodeInfo(Series series, IEnumerable<Episode> remoteEpisodes)
{ {
_logger.Info("Starting series info refresh for: {0}", series); _logger.Info("Starting series info refresh for: {0}", series);
@ -45,19 +44,12 @@ public void RefreshEpisodeInfo(Series series, IEnumerable<Episode> remoteEpisode
{ {
try try
{ {
var episodeToUpdate = existinEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId) ?? var episodeToUpdate = existinEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
existinEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
if (episodeToUpdate != null) if (episodeToUpdate != null)
{ {
existinEpisodes.Remove(episodeToUpdate); existinEpisodes.Remove(episodeToUpdate);
updateList.Add(episodeToUpdate); updateList.Add(episodeToUpdate);
if ((episodeToUpdate.EpisodeNumber != episode.EpisodeNumber || episodeToUpdate.SeasonNumber != episode.SeasonNumber) && episodeToUpdate.EpisodeFileId != 0)
{
_logger.Debug("Un-linking episode file because the episode number has changed");
episodeToUpdate.EpisodeFileId = 0;
}
} }
else else
{ {