diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs index 4911c94c0..e35525f08 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs @@ -31,6 +31,8 @@ namespace NzbDrone.Core.Download.Clients.Deluge public class DelugeProxy : IDelugeProxy { + private static readonly String[] requiredProperties = new String[] { "hash", "name", "state", "progress", "eta", "message", "is_finished", "save_path", "total_size", "total_done", "time_added", "active_time", "ratio", "is_auto_managed", "stop_at_ratio", "remove_at_ratio", "stop_ratio" }; + private readonly Logger _logger; private string _authPassword; @@ -61,9 +63,11 @@ namespace NzbDrone.Core.Download.Clients.Deluge { var filter = new Dictionary(); - var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); + // TODO: get_torrents_status returns the files as well, which starts to cause deluge timeouts when you get enough season packs. + //var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); + var response = ProcessRequest(settings, "web.update_ui", requiredProperties, filter); - return response.Result.Values.ToArray(); + return response.Result.Torrents.Values.ToArray(); } public DelugeTorrent[] GetTorrentsByLabel(String label, DelugeSettings settings) @@ -71,9 +75,11 @@ namespace NzbDrone.Core.Download.Clients.Deluge var filter = new Dictionary(); filter.Add("label", label); - var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); - return response.Result.Values.ToArray(); + //var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); + var response = ProcessRequest(settings, "web.update_ui", requiredProperties, filter); + + return response.Result.Torrents.Values.ToArray(); } public String AddTorrentFromMagnet(String magnetLink, DelugeSettings settings) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs new file mode 100644 index 000000000..2fea430d1 --- /dev/null +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NzbDrone.Core.Download.Clients.Deluge +{ + public class DelugeUpdateUIResult + { + public Dictionary Stats { get; set; } + public Boolean Connected { get; set; } + public Dictionary Torrents { get; set; } + } +} diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index fc25420d8..d969951c7 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -287,6 +287,7 @@ +