|
|
|
@ -69,7 +69,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
|
|
|
|
|
public virtual void PerformUpdate(Series series)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Updating scene numbering mapping for: {0}", series.Title);
|
|
|
|
|
_logger.Trace("Updating scene numbering mapping for: {0}", series);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var episodesToUpdate = new List<Episode>();
|
|
|
|
@ -77,7 +77,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
|
|
|
|
|
if (mappings == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Mappings for: {0} are null, skipping", series.Title);
|
|
|
|
|
_logger.Trace("Mappings for: {0} are null, skipping", series);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -85,7 +85,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
|
|
|
|
|
foreach (var mapping in mappings)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Setting scene numbering mappings for {0} S{1:00}E{2:00}", series.Title, mapping.Tvdb.Season, mapping.Tvdb.Episode);
|
|
|
|
|
_logger.Trace("Setting scene numbering mappings for {0} S{1:00}E{2:00}", series, mapping.Tvdb.Season, mapping.Tvdb.Episode);
|
|
|
|
|
|
|
|
|
|
var episode = episodes.SingleOrDefault(e => e.SeasonNumber == mapping.Tvdb.Season && e.EpisodeNumber == mapping.Tvdb.Episode);
|
|
|
|
|
|
|
|
|
@ -101,10 +101,10 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
episodesToUpdate.Add(episode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.Trace("Committing scene numbering mappings to database for: {0}", series.Title);
|
|
|
|
|
_logger.Trace("Committing scene numbering mappings to database for: {0}", series);
|
|
|
|
|
_episodeService.UpdateEpisodes(episodesToUpdate);
|
|
|
|
|
|
|
|
|
|
_logger.Trace("Setting UseSceneMapping for {0}", series.Title);
|
|
|
|
|
_logger.Trace("Setting UseSceneMapping for {0}", series);
|
|
|
|
|
series.UseSceneNumbering = true;
|
|
|
|
|
_seriesRepository.Update(series);
|
|
|
|
|
}
|
|
|
|
|