diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index cf1732230..7a5231475 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -151,11 +151,11 @@ class Torrent: log.debug("Trying to set an invalid state %s", state) return - if state == "Queued" and not self.handle.is_paused(): - component.get("TorrentManager").append_not_state_paused(self.torrent_id) - self.handle.pause() - if state != self.state: + if state == "Queued" and not self.handle.is_paused(): + component.get("TorrentManager").append_not_state_paused(self.torrent_id) + self.handle.pause() + self.state = state # Update the torrentqueue on any state changes diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 43f55a1cc..f38a6ec2c 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -168,7 +168,8 @@ class TorrentManager(component.Component): """Appends to a list of torrents that we will not set state Paused to when we receive the paused alert from libtorrent. The torrents are removed from this list once we receive the alert they have been paused in libtorrent.""" - self.not_state_paused.append(torrent_id) + if torrent_id not in self.not_state_paused: + self.not_state_paused.append(torrent_id) def add(self, filename, filedump=None, options=None, total_uploaded=0, trackers=None, queue=-1, state=None, save_state=True):