From 80f82b01fedb6c5d2747bbd9ee4b17dba0fa2f6b Mon Sep 17 00:00:00 2001 From: Raphael Baldi Date: Tue, 24 Nov 2015 22:37:08 -0200 Subject: [PATCH] Fixed an issue that would make the status of torrents from Deluge never change to SEEDING if the user opts to seed forever (stop_ratio <= 0) --- couchpotato/core/downloaders/deluge.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/downloaders/deluge.py b/couchpotato/core/downloaders/deluge.py index 3bcbfb6..631925f 100644 --- a/couchpotato/core/downloaders/deluge.py +++ b/couchpotato/core/downloaders/deluge.py @@ -156,7 +156,10 @@ class Deluge(DownloaderBase): # Deluge has no easy way to work out if a torrent is stalled or failing. #status = 'failed' status = 'busy' - if torrent['is_seed'] and tryFloat(torrent['ratio']) < tryFloat(torrent['stop_ratio']): + # If an user opts to seed a torrent forever (usually associated to private trackers usage), stop_ratio will be 0 or -1 (depending on Deluge version). + # In this scenario the status of the torrent would never change from BUSY to SEEDING. + # The last check takes care of this case. + if torrent['is_seed'] and ((tryFloat(torrent['ratio']) < tryFloat(torrent['stop_ratio'])) or (tryFloat(torrent['stop_ratio']) <= 0)): # We have torrent['seeding_time'] to work out what the seeding time is, but we do not # have access to the downloader seed_time, as with deluge we have no way to pass it # when the torrent is added. So Deluge will only look at the ratio.