summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2014-10-03 15:26:50 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2014-10-03 15:26:50 +0100
commit5e1874eb8d296c58618a4c1ebb7d834e7eea2aa7 (patch)
tree77df792ee7d60ae7d63e5d2c7275cd4fb9f26e5b
parent810391316cb425ec254ed2795e9d859dff450557 (diff)
downloaddeluge-5e1874eb8d296c58618a4c1ebb7d834e7eea2aa7.tar.gz
deluge-5e1874eb8d296c58618a4c1ebb7d834e7eea2aa7.tar.bz2
deluge-5e1874eb8d296c58618a4c1ebb7d834e7eea2aa7.zip
Revert "[#1032] Keep track of torrent errors over restarts"
This reverts commit 2c54c696a1bb31a107f86c72341471c76b2fb0c2. This is not working as I intended, will hopefully commit a revised version to 1.3-stable.
-rw-r--r--deluge/core/torrent.py24
-rw-r--r--deluge/core/torrentmanager.py6
2 files changed, 3 insertions, 27 deletions
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"],