diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 6b5093b19..7ca35e139 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -169,11 +169,6 @@ class Torrent(object): # Set the filename self.filename = state.filename self.is_finished = state.is_finished - last_sess_prepend = "[Error from Previous Session] " - if state.error_statusmsg and not state.error_statusmsg.startswith(last_sess_prepend): - self.error_statusmsg = last_sess_prepend + state.error_statusmsg - else: - self.error_statusmsg = state.error_statusmsg else: # Tracker list self.trackers = [] @@ -186,7 +181,6 @@ class Torrent(object): else: tracker = value self.trackers.append(tracker) - self.error_statusmsg = None # Various torrent options self.handle.resolve_countries(True) @@ -389,26 +383,13 @@ class Torrent(object): # First we check for an error from libtorrent, and set the state to that # if any occurred. - status_error = deluge.common.decode_string(self.handle.status().error) - if status_error or self.error_statusmsg: + if len(self.handle.status().error) > 0: # This is an error'd torrent self.state = "Error" - if status_error: - self.error_statusmsg = status_error - self.set_status_message(self.error_statusmsg) - + self.set_status_message(self.handle.status().error) if self.handle.is_paused(): self.handle.auto_managed(False) - else: - self.handle.pause() - - if not status_error: - # As this is not a libtorrent Error we should emit a state changed event - component.get("EventManager").emit(TorrentStateChangedEvent(self.torrent_id, "Error")) return - else: - self.set_status_message("OK") - self.error_statusmsg = None if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]: if self.handle.is_paused(): @@ -822,7 +803,6 @@ class Torrent(object): else: # Reset the status message just in case of resuming an Error'd torrent self.set_status_message("OK") - self.error_statusmsg = None if self.handle.is_finished(): # If the torrent has already reached it's 'stop_seed_ratio' then do not do anything diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 7eb9c06ff..536b5ddf5 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -77,7 +77,6 @@ class TorrentState: queue=None, auto_managed=True, is_finished=False, - error_statusmsg=None, stop_ratio=2.00, stop_at_ratio=False, remove_at_ratio=False, @@ -92,7 +91,6 @@ class TorrentState: self.trackers = trackers self.queue = queue self.is_finished = is_finished - self.error_statusmsg = error_statusmsg self.magnet = magnet self.time_added = time_added @@ -113,7 +111,6 @@ class TorrentState: self.move_completed = move_completed self.move_completed_path = move_completed_path - class TorrentManagerState: def __init__(self): self.torrents = [] @@ -675,7 +672,7 @@ class TorrentManager(component.Component): # Create the state for each Torrent and append to the list for torrent in self.torrents.values(): paused = False - if torrent.state in ["Paused", "Error"]: + if torrent.state == "Paused": paused = True torrent_state = TorrentState( @@ -695,7 +692,6 @@ class TorrentManager(component.Component): torrent.get_queue_position(), torrent.options["auto_managed"], torrent.is_finished, - torrent.error_statusmsg, torrent.options["stop_ratio"], torrent.options["stop_at_ratio"], torrent.options["remove_at_ratio"],