diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 935acba97..c3c66b031 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -360,14 +360,16 @@ class Torrent: elif self.state == "Queued": if self.handle.is_seed(): - if self.torrentqueue.get_num_seeding() < self.config["max_active_seeding"]: + if self.torrentqueue.get_num_seeding() < self.config["max_active_seeding"] or\ + self.config["max_active_seeding"] == -1: self.handle.resume() self.state = "Seeding" self.torrentqueue.update_order() else: return False else: - if self.torrentqueue.get_num_downloading() < self.config["max_active_downloading"]: + if self.torrentqueue.get_num_downloading() < self.config["max_active_downloading"] or\ + self.config["max_active_downloading"] == -1: self.handle.resume() self.state = "Downloading" self.torrentqueue.update_order() diff --git a/deluge/core/torrentqueue.py b/deluge/core/torrentqueue.py index 02123e824..b52f4cd64 100644 --- a/deluge/core/torrentqueue.py +++ b/deluge/core/torrentqueue.py @@ -118,9 +118,13 @@ class TorrentQueue(component.Component): else: to_unqueue = self.queued_seeding for (pos, torrent_id) in to_unqueue: - #self.torrents[torrent_id].set_state("Seeding") self.torrents[torrent_id].resume() - + else: + # The max_active_seeding is set to unlimited, so lets make sure + # all queued seeds are activated. + for (pos, torrent_id) in self.queued_seeding: + self.torrents[torrent_id].resume() + if self.config["max_active_downloading"] > -1: if len(self.downloading) > self.config["max_active_downloading"]: num_to_queue = len(self.downloading) - self.config["max_active_downloading"] @@ -135,8 +139,11 @@ class TorrentQueue(component.Component): else: to_unqueue = self.queued_downloading for (pos, torrent_id) in to_unqueue: - #self.torrents[torrent_id].set_state("Downloading") self.torrents[torrent_id].resume() + else: + # Unlimited downloading torrents set + for (pos, torrent_id) in self.queued_downloading: + self.torrents[torrent_id].resume() def set_size(self, size): """Clear and set the self.queue list to the length of size"""