Skip to content

Commit

Permalink
Handle Deluge v2 beta breaking change in their api.
Browse files Browse the repository at this point in the history
closes #2412
  • Loading branch information
Taloth committed Mar 3, 2019
1 parent 08ba273 commit e52fcf8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs
Expand Up @@ -48,9 +48,25 @@ public DelugeProxy(ICacheManager cacheManager, IHttpClient httpClient, Logger lo

public string GetVersion(DelugeSettings settings)
{
var response = ProcessRequest<string>(settings, "daemon.info");
try
{
var response = ProcessRequest<string>(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<string>(settings, "daemon.get_version");

return response;
}

throw;
}
}

public Dictionary<string, object> GetConfig(DelugeSettings settings)
Expand Down

0 comments on commit e52fcf8

Please sign in to comment.