mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Fixed: Don't use invalid scene mappings. Fixes #1627
This commit is contained in:
parent
b9df5634bf
commit
563b5ef017
@ -5,6 +5,7 @@
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.DataAugmentation.Xem;
|
||||
using NzbDrone.Core.DataAugmentation.Xem.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
@ -98,7 +99,6 @@ private void AddTvdbMapping(int sceneAbsolute, int sceneSeason, int sceneEpisode
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_not_fetch_scenenumbering_if_not_listed()
|
||||
{
|
||||
@ -308,5 +308,19 @@ public void should_not_extrapolate_matching_future_seasons()
|
||||
episode.SceneSeasonNumber.Should().NotHaveValue();
|
||||
episode.SceneEpisodeNumber.Should().NotHaveValue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_skip_mapping_when_scene_information_is_all_zero()
|
||||
{
|
||||
GivenTvdbMappings();
|
||||
|
||||
AddTvdbMapping(0, 0, 0, 8, 3, 1); // 3x01 -> 3x01
|
||||
AddTvdbMapping(0, 0, 0, 9, 3, 2); // 3x02 -> 3x02
|
||||
|
||||
Subject.Handle(new SeriesUpdatedEvent(_series));
|
||||
|
||||
Mocker.GetMock<IEpisodeService>()
|
||||
.Verify(v => v.UpdateEpisodes(It.Is<List<Episode>>(e => e.Any(c => c.SceneAbsoluteEpisodeNumber == 0 && c.SceneSeasonNumber == 0 && c.SceneEpisodeNumber == 0))), Times.Never());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,15 @@ private void PerformUpdate(Series series)
|
||||
|
||||
if (episode == null)
|
||||
{
|
||||
_logger.Debug("Information hasn't been added to TheTVDB yet, skipping.");
|
||||
_logger.Debug("Information hasn't been added to TheTVDB yet, skipping");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mapping.Scene.Absolute == 0 &&
|
||||
mapping.Scene.Season == 0 &&
|
||||
mapping.Scene.Episode == 0)
|
||||
{
|
||||
_logger.Debug("Mapping for {0} S{1:00}E{2:00} is invalid, skipping", series, mapping.Tvdb.Season, mapping.Tvdb.Episode);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user