From da75519524948d5a43e54389ef285c5a60863331 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 5 Jun 2023 17:22:30 +0300 Subject: [PATCH] Fixed: (Deluge) Set seed limits in client --- src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs | 12 ++++++++---- .../Download/Clients/Deluge/DelugeException.cs | 2 +- .../Download/Clients/Deluge/DelugeProxy.cs | 4 ++-- .../Download/Clients/Deluge/DelugeTorrentStatus.cs | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index caa83fbdc..8f862525b 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -38,8 +38,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge throw new DownloadClientException("Deluge failed to add magnet " + magnetLink); } - // _proxy.SetTorrentSeedingConfiguration(actualHash, remoteMovie.SeedConfiguration, Settings); + _proxy.SetTorrentSeedingConfiguration(actualHash, release.SeedConfiguration, Settings); + var category = GetCategoryForRelease(release) ?? Settings.Category; + if (category.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(actualHash, category, Settings); @@ -62,8 +64,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge throw new DownloadClientException("Deluge failed to add torrent " + filename); } - // _proxy.SetTorrentSeedingConfiguration(actualHash, release.SeedConfiguration, Settings); + _proxy.SetTorrentSeedingConfiguration(actualHash, release.SeedConfiguration, Settings); + var category = GetCategoryForRelease(release) ?? Settings.Category; + if (category.IsNotNullOrWhiteSpace()) { _proxy.SetTorrentLabel(actualHash, category, Settings); @@ -117,12 +121,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge case WebExceptionStatus.ConnectionClosed: return new NzbDroneValidationFailure("UseSsl", "Verify SSL settings") { - DetailedDescription = "Please verify your SSL configuration on both Deluge and NzbDrone." + DetailedDescription = "Please verify your SSL configuration on both Deluge and Prowlarr." }; case WebExceptionStatus.SecureChannelFailure: return new NzbDroneValidationFailure("UseSsl", "Unable to connect through SSL") { - DetailedDescription = "Drone is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both drone and Deluge to not use SSL." + DetailedDescription = "Prowlarr is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both Prowlarr and Deluge to not use SSL." }; default: return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs index 45df09c8c..fb6ca2a8a 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs @@ -1,4 +1,4 @@ -namespace NzbDrone.Core.Download.Clients.Deluge +namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeException : DownloadClientException { diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs index 77b3d1b3d..7639ad7df 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs @@ -82,7 +82,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge var filter = new Dictionary(); // 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, "core.get_torrents_status", filter, new String[0]); var response = ProcessRequest(settings, "web.update_ui", RequiredProperties, filter); return GetTorrents(response); @@ -93,7 +93,7 @@ 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]); + // var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); var response = ProcessRequest(settings, "web.update_ui", RequiredProperties, filter); return GetTorrents(response); diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs index e9f5a6a70..52114f241 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs @@ -1,6 +1,6 @@ -namespace NzbDrone.Core.Download.Clients.Deluge +namespace NzbDrone.Core.Download.Clients.Deluge { - internal class DelugeTorrentStatus + public class DelugeTorrentStatus { public const string Paused = "Paused"; public const string Queued = "Queued";