From db4746bef72719d24a964c2defce2197714d4cb4 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 22 Mar 2015 21:42:55 +0100 Subject: [PATCH] Failed DeleteStatus now only a Warning, also added null check to handle older NzbGet version. --- .../NzbgetTests/NzbgetFixture.cs | 13 +++++++++++++ src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index 21f9dccc0..48e477fee 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -213,6 +213,19 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests result.Status.Should().Be(DownloadItemStatus.Failed); } + [Test] + public void should_report_deletestatus_dupe_as_warning() + { + _completed.DeleteStatus = "DUPE"; + + GivenQueue(null); + GivenHistory(_completed); + + var result = Subject.GetItems().Single(); + + result.Status.Should().Be(DownloadItemStatus.Warning); + } + [Test] public void should_report_unpackstatus_freespace_as_warning() { diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 81429c5b0..0963fa4a8 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -167,7 +167,12 @@ namespace NzbDrone.Core.Download.Clients.Nzbget historyItem.Status = DownloadItemStatus.Failed; } - if (!successStatus.Contains(item.DeleteStatus)) + if (!successStatus.Contains(item.DeleteStatus) && item.DeleteStatus.IsNotNullOrWhiteSpace()) + { + historyItem.Status = DownloadItemStatus.Warning; + } + + if (item.DeleteStatus == "HEALTH") { historyItem.Status = DownloadItemStatus.Failed; }