fixed episodeservice.updatemany

pull/4/head
kay.one 12 years ago
parent 6c1d16ae57
commit 287dedadea

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

@ -99,13 +99,9 @@ namespace NzbDrone.Core.Tv
{
_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)
{

Loading…
Cancel
Save