From e52fcf843c092441f6d79128d744a2183d7871fa Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 3 Mar 2019 23:10:02 +0100 Subject: [PATCH] Handle Deluge v2 beta breaking change in their api. closes #2412 --- .../Download/Clients/Deluge/DelugeProxy.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs index 21a34e2be..80912667f 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs @@ -48,9 +48,25 @@ namespace NzbDrone.Core.Download.Clients.Deluge public string GetVersion(DelugeSettings settings) { - var response = ProcessRequest(settings, "daemon.info"); + try + { + var response = ProcessRequest(settings, "daemon.info"); - return response; + return response; + } + catch (DownloadClientException ex) + { + if (ex.Message.Contains("Unknown method")) + { + // Deluge v2 beta replaced 'daemon.info' with 'daemon.get_version'. + // It may return or become official, for now we just retry with the get_version api. + var response = ProcessRequest(settings, "daemon.get_version"); + + return response; + } + + throw; + } } public Dictionary GetConfig(DelugeSettings settings)