Fixed: Don't mark downloads as failed if no files found

Resolves #945
This commit is contained in:
ta264 2020-02-09 19:19:49 +00:00 committed by Qstick
parent 6cfb54030b
commit c4cf178144
2 changed files with 13 additions and 2 deletions

View File

@ -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<IDownloadedTracksImportService>()
.Setup(v => v.ProcessPath(It.IsAny<string>(), It.IsAny<ImportMode>(), It.IsAny<Artist>(), It.IsAny<DownloadClientItem>()))
.Returns(new List<ImportResult>());
Subject.Process(_trackedDownload);
AssertNoCompletedDownload();
_trackedDownload.State.Should().NotBe(TrackedDownloadStage.ImportFailed);
}
[Test]
public void should_not_mark_as_imported_if_all_files_were_skipped()
{

View File

@ -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;
}