mirror of https://github.com/Radarr/Radarr
Fixing scene mappings
This commit is contained in:
parent
2feb583e45
commit
ecd941a6e5
|
@ -136,13 +136,13 @@ namespace NzbDrone.Core.Test.DataAugmentationFixture.Scene
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_not_add_mapping_with_blank_parse_title()
|
public void should_not_add_mapping_with_blank_title()
|
||||||
{
|
{
|
||||||
GivenProviders(new[] { _provider1 });
|
GivenProviders(new[] { _provider1 });
|
||||||
|
|
||||||
var fakeMappings = Builder<SceneMapping>.CreateListOfSize(2)
|
var fakeMappings = Builder<SceneMapping>.CreateListOfSize(2)
|
||||||
.TheLast(1)
|
.TheLast(1)
|
||||||
.With(m => m.ParseTerm = null)
|
.With(m => m.Title = null)
|
||||||
.Build()
|
.Build()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ namespace NzbDrone.Core.Test.DataAugmentationFixture.Scene
|
||||||
|
|
||||||
Subject.Execute(new UpdateSceneMappingCommand());
|
Subject.Execute(new UpdateSceneMappingCommand());
|
||||||
|
|
||||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(It.Is<IList<SceneMapping>>(m => !m.Any(s => s.ParseTerm.IsNullOrWhiteSpace()))), Times.Once());
|
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(It.Is<IList<SceneMapping>>(m => !m.Any(s => s.Title.IsNullOrWhiteSpace()))), Times.Once());
|
||||||
ExceptionVerification.ExpectedWarns(1);
|
ExceptionVerification.ExpectedWarns(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene
|
||||||
|
|
||||||
mappings.RemoveAll(sceneMapping =>
|
mappings.RemoveAll(sceneMapping =>
|
||||||
{
|
{
|
||||||
if (sceneMapping.ParseTerm.IsNullOrWhiteSpace() ||
|
if (sceneMapping.Title.IsNullOrWhiteSpace() ||
|
||||||
sceneMapping.SearchTerm.IsNullOrWhiteSpace())
|
sceneMapping.SearchTerm.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
_logger.Warn("Invalid scene mapping found for: {0}, skipping", sceneMapping.TvdbId);
|
_logger.Warn("Invalid scene mapping found for: {0}, skipping", sceneMapping.TvdbId);
|
||||||
|
|
Loading…
Reference in New Issue