diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index a4320059a..45d92f4e0 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -210,7 +210,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests } [Test] - public void should_report_health_deletestatus_as_failed() + public void should_report_deletestatus_health_as_failed() { _completed.DeleteStatus = "HEALTH"; @@ -223,9 +223,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests } [Test] - public void should_report_script_error_as_warning() + public void should_report_unpackstatus_freespace_as_warning() { - _completed.ScriptStatus = "FAILED"; + _completed.UnpackStatus = "SPACE"; GivenQueue(null); GivenHistory(_completed); @@ -235,6 +235,35 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests items.First().Status.Should().Be(DownloadItemStatus.Warning); } + [Test] + public void should_report_movestatus_failure_as_warning() + { + _completed.MoveStatus = "FAILURE"; + + GivenQueue(null); + GivenHistory(_completed); + + var items = Subject.GetItems(); + + items.First().Status.Should().Be(DownloadItemStatus.Warning); + } + + [Test] + public void should_report_scriptstatus_failure_as_failed() + { + // TODO: We would love to have a way to distinguish between scripts reporting video corruption, or some internal script error. + // That way we could return Warning instead of Failed to notify the user to take action. + + _completed.ScriptStatus = "FAILURE"; + + GivenQueue(null); + GivenHistory(_completed); + + var items = Subject.GetItems(); + + items.First().Status.Should().Be(DownloadItemStatus.Failed); + } + [Test] public void Download_should_return_unique_id() diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index b26b12e99..1ea2c003c 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -158,17 +158,29 @@ namespace NzbDrone.Core.Download.Clients.Nzbget continue; } - if (!successStatus.Contains(item.ParStatus) || - !successStatus.Contains(item.UnpackStatus) || - !successStatus.Contains(item.MoveStatus)) + if (!successStatus.Contains(item.ParStatus)) { historyItem.Status = DownloadItemStatus.Failed; } - if (!successStatus.Contains(item.ScriptStatus)) + if (item.UnpackStatus == "SPACE") { historyItem.Status = DownloadItemStatus.Warning; } + else if (!successStatus.Contains(item.UnpackStatus)) + { + historyItem.Status = DownloadItemStatus.Failed; + } + + if (!successStatus.Contains(item.MoveStatus)) + { + historyItem.Status = DownloadItemStatus.Warning; + } + + if (!successStatus.Contains(item.ScriptStatus)) + { + historyItem.Status = DownloadItemStatus.Failed; + } if (!successStatus.Contains(item.DeleteStatus)) {