1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-27 18:28:19 +00:00

Fixed missing existingfile flag.

This commit is contained in:
Taloth Saldono 2018-04-15 16:24:32 +02:00
parent 62f7e90748
commit 5b627a8bc2
2 changed files with 8 additions and 6 deletions

View file

@ -54,6 +54,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
_fail3.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Reject("_fail3"));
_series = Builder<Series>.CreateNew()
.With(e => e.Path = @"C:\Test\Series".AsOsAgnostic())
.With(e => e.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities() })
.Build();
@ -101,7 +102,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
GivenAugmentationSuccess();
GivenSpecifications(_pass1, _pass2, _pass3, _fail1, _fail2, _fail3);
Subject.GetImportDecisions(_videoFiles, new Series(), downloadClientItem, null, false);
Subject.GetImportDecisions(_videoFiles, _series, downloadClientItem, null, false);
_fail1.Verify(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), downloadClientItem), Times.Once());
_fail2.Verify(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), downloadClientItem), Times.Once());
@ -116,7 +117,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
{
GivenSpecifications(_fail1);
var result = Subject.GetImportDecisions(_videoFiles, new Series());
var result = Subject.GetImportDecisions(_videoFiles, _series);
result.Single().Approved.Should().BeFalse();
}
@ -126,7 +127,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
{
GivenSpecifications(_pass1, _fail1, _pass2, _pass3);
var result = Subject.GetImportDecisions(_videoFiles, new Series());
var result = Subject.GetImportDecisions(_videoFiles, _series);
result.Single().Approved.Should().BeFalse();
}
@ -137,7 +138,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
GivenAugmentationSuccess();
GivenSpecifications(_pass1, _pass2, _pass3);
var result = Subject.GetImportDecisions(_videoFiles, new Series());
var result = Subject.GetImportDecisions(_videoFiles, _series);
result.Single().Approved.Should().BeTrue();
}
@ -148,7 +149,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
GivenAugmentationSuccess();
GivenSpecifications(_pass1, _pass2, _pass3, _fail1, _fail2, _fail3);
var result = Subject.GetImportDecisions(_videoFiles, new Series());
var result = Subject.GetImportDecisions(_videoFiles, _series);
result.Single().Rejections.Should().HaveCount(3);
}

View file

@ -73,7 +73,8 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
DownloadClientEpisodeInfo = downloadClientItemInfo,
FolderEpisodeInfo = folderInfo,
Path = file,
SceneSource = sceneSource
SceneSource = sceneSource,
ExistingFile = series.Path.IsParentPath(file)
};
decisions.AddIfNotNull(GetDecision(localEpisode, downloadClientItem, nonSampleVideoFileCount > 1));