mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 03:36:16 +00:00
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.
This commit is contained in:
parent
810391316c
commit
5e1874eb8d
@ -169,11 +169,6 @@ class Torrent(object):
|
|||||||
# Set the filename
|
# Set the filename
|
||||||
self.filename = state.filename
|
self.filename = state.filename
|
||||||
self.is_finished = state.is_finished
|
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:
|
else:
|
||||||
# Tracker list
|
# Tracker list
|
||||||
self.trackers = []
|
self.trackers = []
|
||||||
@ -186,7 +181,6 @@ class Torrent(object):
|
|||||||
else:
|
else:
|
||||||
tracker = value
|
tracker = value
|
||||||
self.trackers.append(tracker)
|
self.trackers.append(tracker)
|
||||||
self.error_statusmsg = None
|
|
||||||
|
|
||||||
# Various torrent options
|
# Various torrent options
|
||||||
self.handle.resolve_countries(True)
|
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
|
# First we check for an error from libtorrent, and set the state to that
|
||||||
# if any occurred.
|
# if any occurred.
|
||||||
status_error = deluge.common.decode_string(self.handle.status().error)
|
if len(self.handle.status().error) > 0:
|
||||||
if status_error or self.error_statusmsg:
|
|
||||||
# This is an error'd torrent
|
# This is an error'd torrent
|
||||||
self.state = "Error"
|
self.state = "Error"
|
||||||
if status_error:
|
self.set_status_message(self.handle.status().error)
|
||||||
self.error_statusmsg = status_error
|
|
||||||
self.set_status_message(self.error_statusmsg)
|
|
||||||
|
|
||||||
if self.handle.is_paused():
|
if self.handle.is_paused():
|
||||||
self.handle.auto_managed(False)
|
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
|
return
|
||||||
else:
|
|
||||||
self.set_status_message("OK")
|
|
||||||
self.error_statusmsg = None
|
|
||||||
|
|
||||||
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
|
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
|
||||||
if self.handle.is_paused():
|
if self.handle.is_paused():
|
||||||
@ -822,7 +803,6 @@ class Torrent(object):
|
|||||||
else:
|
else:
|
||||||
# Reset the status message just in case of resuming an Error'd torrent
|
# Reset the status message just in case of resuming an Error'd torrent
|
||||||
self.set_status_message("OK")
|
self.set_status_message("OK")
|
||||||
self.error_statusmsg = None
|
|
||||||
|
|
||||||
if self.handle.is_finished():
|
if self.handle.is_finished():
|
||||||
# If the torrent has already reached it's 'stop_seed_ratio' then do not do anything
|
# If the torrent has already reached it's 'stop_seed_ratio' then do not do anything
|
||||||
|
@ -77,7 +77,6 @@ class TorrentState:
|
|||||||
queue=None,
|
queue=None,
|
||||||
auto_managed=True,
|
auto_managed=True,
|
||||||
is_finished=False,
|
is_finished=False,
|
||||||
error_statusmsg=None,
|
|
||||||
stop_ratio=2.00,
|
stop_ratio=2.00,
|
||||||
stop_at_ratio=False,
|
stop_at_ratio=False,
|
||||||
remove_at_ratio=False,
|
remove_at_ratio=False,
|
||||||
@ -92,7 +91,6 @@ class TorrentState:
|
|||||||
self.trackers = trackers
|
self.trackers = trackers
|
||||||
self.queue = queue
|
self.queue = queue
|
||||||
self.is_finished = is_finished
|
self.is_finished = is_finished
|
||||||
self.error_statusmsg = error_statusmsg
|
|
||||||
self.magnet = magnet
|
self.magnet = magnet
|
||||||
self.time_added = time_added
|
self.time_added = time_added
|
||||||
|
|
||||||
@ -113,7 +111,6 @@ class TorrentState:
|
|||||||
self.move_completed = move_completed
|
self.move_completed = move_completed
|
||||||
self.move_completed_path = move_completed_path
|
self.move_completed_path = move_completed_path
|
||||||
|
|
||||||
|
|
||||||
class TorrentManagerState:
|
class TorrentManagerState:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.torrents = []
|
self.torrents = []
|
||||||
@ -675,7 +672,7 @@ class TorrentManager(component.Component):
|
|||||||
# Create the state for each Torrent and append to the list
|
# Create the state for each Torrent and append to the list
|
||||||
for torrent in self.torrents.values():
|
for torrent in self.torrents.values():
|
||||||
paused = False
|
paused = False
|
||||||
if torrent.state in ["Paused", "Error"]:
|
if torrent.state == "Paused":
|
||||||
paused = True
|
paused = True
|
||||||
|
|
||||||
torrent_state = TorrentState(
|
torrent_state = TorrentState(
|
||||||
@ -695,7 +692,6 @@ class TorrentManager(component.Component):
|
|||||||
torrent.get_queue_position(),
|
torrent.get_queue_position(),
|
||||||
torrent.options["auto_managed"],
|
torrent.options["auto_managed"],
|
||||||
torrent.is_finished,
|
torrent.is_finished,
|
||||||
torrent.error_statusmsg,
|
|
||||||
torrent.options["stop_ratio"],
|
torrent.options["stop_ratio"],
|
||||||
torrent.options["stop_at_ratio"],
|
torrent.options["stop_at_ratio"],
|
||||||
torrent.options["remove_at_ratio"],
|
torrent.options["remove_at_ratio"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user