1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

fixed episodeservice.updatemany

This commit is contained in:
kay.one 2013-06-02 20:56:17 -07:00
parent 6c1d16ae57
commit 287dedadea
2 changed files with 4 additions and 8 deletions

View File

@ -164,7 +164,7 @@ public void InsertMany(List<Episode> episodes)
public void UpdateMany(List<Episode> episodes)
{
_episodeRepository.InsertMany(episodes);
_episodeRepository.UpdateMany(episodes);
}
public void HandleAsync(SeriesDeletedEvent message)

View File

@ -99,13 +99,9 @@ private void RefreshEpisodeInfo(Series series, List<Episode> remoteEpisodes)
{
_logger.Trace("Updating info for [{0}] - S{1:00}E{2:00}", series.Title, episode.SeasonNumber, episode.EpisodeNumber);
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId);
//not found, try using season/episode number
if (episodeToUpdate == null)
{
episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
}
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e =>
e.TvDbEpisodeId == episode.TvDbEpisodeId ||
(e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber));
if (episodeToUpdate == null)
{