From 93c6047cd51e4b18c76294eca260dace11ea40b4 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 21 Mar 2015 21:28:23 +0100 Subject: [PATCH] Added Nzbget version check for 12.0 or higher. --- src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs | 7 ++++++- src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 0963fa4a89..cbdd3f4385 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -254,7 +254,12 @@ private ValidationFailure TestConnection() { try { - _proxy.GetVersion(Settings); + var version = _proxy.GetVersion(Settings); + + if (Version.Parse(version) < Version.Parse("12.0")) + { + return new ValidationFailure(string.Empty, "Nzbget version too low, need 12.0 or higher"); + } } catch (Exception ex) { diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs index 02e95b3d0a..f197855d0e 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs @@ -86,7 +86,7 @@ public String GetVersion(NzbgetSettings settings) { var request = BuildRequest(new JsonRequest("version")); - return Json.Deserialize>(ProcessRequest(request, settings)).Version; + return Json.Deserialize>(ProcessRequest(request, settings)).Result; } public Dictionary GetConfig(NzbgetSettings settings)