mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-12 03:18:47 +00:00
Fix displaying file errors when the torrent isn't paused
This commit is contained in:
parent
3f03cb967a
commit
51ddc35140
2 changed files with 10 additions and 2 deletions
|
@ -353,11 +353,12 @@ class Torrent:
|
||||||
|
|
||||||
# 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.
|
||||||
if self.handle.is_paused() and len(self.handle.status().error) > 0:
|
if len(self.handle.status().error) > 0:
|
||||||
# This is an error'd torrent
|
# This is an error'd torrent
|
||||||
self.state = "Error"
|
self.state = "Error"
|
||||||
self.set_status_message(self.handle.status().error)
|
self.set_status_message(self.handle.status().error)
|
||||||
self.handle.auto_managed(False)
|
if self.handle.is_paused():
|
||||||
|
self.handle.auto_managed(False)
|
||||||
return
|
return
|
||||||
|
|
||||||
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
|
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
|
||||||
|
|
|
@ -166,6 +166,8 @@ class TorrentManager(component.Component):
|
||||||
self.on_alert_file_renamed)
|
self.on_alert_file_renamed)
|
||||||
self.alerts.register_handler("metadata_received_alert",
|
self.alerts.register_handler("metadata_received_alert",
|
||||||
self.on_alert_metadata_received)
|
self.on_alert_metadata_received)
|
||||||
|
self.alerts.register_handler("file_error_alert",
|
||||||
|
self.on_alert_file_error)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
# Get the pluginmanager reference
|
# Get the pluginmanager reference
|
||||||
|
@ -779,3 +781,8 @@ class TorrentManager(component.Component):
|
||||||
log.debug("on_alert_metadata_received")
|
log.debug("on_alert_metadata_received")
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
torrent.write_torrentfile()
|
torrent.write_torrentfile()
|
||||||
|
|
||||||
|
def on_alert_file_error(self, alert):
|
||||||
|
log.debug("on_alert_file_error: %s", alert.message())
|
||||||
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
|
torrent.update_state()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue