1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Handle Deluge v2 beta breaking change in their api.

closes #2412
This commit is contained in:
Taloth Saldono 2019-03-03 23:10:02 +01:00
parent 08ba273089
commit e52fcf843c

View File

@ -47,11 +47,27 @@ public DelugeProxy(ICacheManager cacheManager, IHttpClient httpClient, Logger lo
}
public string GetVersion(DelugeSettings settings)
{
try
{
var response = ProcessRequest<string>(settings, "daemon.info");
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)
{