Attempt to fix issue where core will no longer pause/resume torrents.

This commit is contained in:
Andrew Resch 2008-03-18 01:41:09 +00:00
parent d34356a800
commit fc9bb503df
2 changed files with 6 additions and 5 deletions

View File

@ -151,11 +151,11 @@ class Torrent:
log.debug("Trying to set an invalid state %s", state) log.debug("Trying to set an invalid state %s", state)
return 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 != 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 self.state = state
# Update the torrentqueue on any state changes # Update the torrentqueue on any state changes

View File

@ -168,7 +168,8 @@ class TorrentManager(component.Component):
"""Appends to a list of torrents that we will not set state Paused to """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 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.""" 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, def add(self, filename, filedump=None, options=None, total_uploaded=0,
trackers=None, queue=-1, state=None, save_state=True): trackers=None, queue=-1, state=None, save_state=True):