From 5b627a8bc24e3c432dc9e9120491d20e73137822 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 15 Apr 2018 16:24:32 +0200 Subject: [PATCH] Fixed missing existingfile flag. --- .../EpisodeImport/ImportDecisionMakerFixture.cs | 11 ++++++----- .../MediaFiles/EpisodeImport/ImportDecisionMaker.cs | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs index 09ee280ed..416311940 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs @@ -54,6 +54,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport _fail3.Setup(c => c.IsSatisfiedBy(It.IsAny(), It.IsAny())).Returns(Decision.Reject("_fail3")); _series = Builder.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(), downloadClientItem), Times.Once()); _fail2.Verify(c => c.IsSatisfiedBy(It.IsAny(), 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); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index 7d066bf31..2b3291006 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -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));