From c4cf178144cd0db699da7c9f39ad857b7fea730d Mon Sep 17 00:00:00 2001 From: ta264 Date: Sun, 9 Feb 2020 19:19:49 +0000 Subject: [PATCH] Fixed: Don't mark downloads as failed if no files found Resolves #945 --- .../Download/CompletedDownloadServiceFixture.cs | 13 +++++++++++++ .../Download/CompletedDownloadService.cs | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs index 433f38b20..c4374e1bd 100644 --- a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs @@ -283,6 +283,19 @@ namespace NzbDrone.Core.Test.Download AssertImportIncomplete(); } + [Test] + public void should_not_mark_as_failed_if_nothing_found_to_import() + { + Mocker.GetMock() + .Setup(v => v.ProcessPath(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(new List()); + + Subject.Process(_trackedDownload); + + AssertNoCompletedDownload(); + _trackedDownload.State.Should().NotBe(TrackedDownloadStage.ImportFailed); + } + [Test] public void should_not_mark_as_imported_if_all_files_were_skipped() { diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs index 9195fc942..ba4cddab2 100644 --- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs +++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs @@ -108,9 +108,7 @@ namespace NzbDrone.Core.Download if (importResults.Empty()) { - trackedDownload.State = TrackedDownloadStage.ImportFailed; trackedDownload.Warn("No files found are eligible for import in {0}", outputPath); - _eventAggregator.PublishEvent(new AlbumImportIncompleteEvent(trackedDownload)); return; }