diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs index 7d625b01a..ebdcca7ed 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs @@ -97,19 +97,19 @@ private void CheckForError(IRestResponse response) if (response.Content.StartsWith("error", StringComparison.InvariantCultureIgnoreCase)) { - result.Status = false; + result.Status = "false"; result.Error = response.Content.Replace("error: ", ""); } else { - result.Status = true; + result.Status = "true"; } result.Error = response.Content.Replace("error: ", ""); } - if (!result.Status) + if (result.Failed) throw new ApplicationException(result.Error); } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabJsonError.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabJsonError.cs index 30fab767c..8ad40b398 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabJsonError.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabJsonError.cs @@ -1,8 +1,19 @@ -namespace NzbDrone.Core.Download.Clients.Sabnzbd +using System; + +namespace NzbDrone.Core.Download.Clients.Sabnzbd { public class SabJsonError { - public bool Status { get; set; } + public string Status { get; set; } public string Error { get; set; } + + public bool Failed + { + get + { + return !String.IsNullOrWhiteSpace(Status) && + Status.Equals("false", StringComparison.InvariantCultureIgnoreCase); + } + } } } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs index f82af3874..5535eb00b 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdClient.cs @@ -243,7 +243,7 @@ private void CheckForError(string response) { var result = Json.Deserialize(response); - if (result.Status) + if (result.Failed) throw new ApplicationException(result.Error); } }