From 94075a9bf6a8f78a96f96fff47eed41baac0762e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 16 Jan 2021 16:24:30 -0800 Subject: [PATCH] New: Treat Manual Bad in history as failed (cherry picked from commit ab478fd64bdf2b710fb865006858a1a7dbdbad21) --- .../NzbgetTests/NzbgetFixture.cs | 25 +++++++++++++++++++ .../Download/Clients/Nzbget/Nzbget.cs | 7 ++++++ 2 files changed, 32 insertions(+) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index 7c07bc3b0..5cc1c8e2f 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -424,6 +424,31 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests Subject.GetItems().First().OutputPath.Should().Be(_completed.DestDir); } + [Test] + public void should_report_deletestatus_manual_with_markstatus_bad_as_failed() + { + _completed.DeleteStatus = "MANUAL"; + _completed.MarkStatus = "BAD"; + + GivenQueue(null); + GivenHistory(_completed); + + var result = Subject.GetItems().Single(); + + result.Status.Should().Be(DownloadItemStatus.Failed); + } + + [Test] + public void should_ignore_deletestatus_manual_without_markstatus() + { + _completed.DeleteStatus = "MANUAL"; + + GivenQueue(null); + GivenHistory(_completed); + + Subject.GetItems().Should().BeEmpty(); + } + [Test] public void should_use_final_dir_when_set_instead_of_dest_dir() { diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index db95dd9d7..654358764 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -133,6 +133,13 @@ namespace NzbDrone.Core.Download.Clients.Nzbget if (item.DeleteStatus == "MANUAL") { + if (item.MarkStatus == "BAD") + { + historyItem.Status = DownloadItemStatus.Failed; + + historyItems.Add(historyItem); + } + continue; }