mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix #1928 : Crash when dragging column header
The fix specifically applied to on_alert_save_resume_data by moving function call str(alert.handle.info_hash()) into the try statement. For completeness any calls to str(alert.handle.info_hash()) also moved into try statements.
This commit is contained in:
parent
683e4be529
commit
f0c4a4c766
1 changed files with 14 additions and 13 deletions
|
@ -17,9 +17,9 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with deluge. If not, write to:
|
# along with deluge. If not, write to:
|
||||||
# The Free Software Foundation, Inc.,
|
# The Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor
|
# 51 Franklin Street, Fifth Floor
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# In addition, as a special exception, the copyright holders give
|
# In addition, as a special exception, the copyright holders give
|
||||||
# permission to link the code of portions of this program with the OpenSSL
|
# permission to link the code of portions of this program with the OpenSSL
|
||||||
|
@ -149,7 +149,7 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
# Keeps track of resume data that needs to be saved to disk
|
# Keeps track of resume data that needs to be saved to disk
|
||||||
self.resume_data = {}
|
self.resume_data = {}
|
||||||
|
|
||||||
# Workaround to determine if TorrentAddedEvent is from state file
|
# Workaround to determine if TorrentAddedEvent is from state file
|
||||||
self.session_started = False
|
self.session_started = False
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ class TorrentManager(component.Component):
|
||||||
if options["mapped_files"]:
|
if options["mapped_files"]:
|
||||||
for index, filename in options["mapped_files"].items():
|
for index, filename in options["mapped_files"].items():
|
||||||
filename = deluge.core.torrent.sanitize_filepath(filename)
|
filename = deluge.core.torrent.sanitize_filepath(filename)
|
||||||
log.debug("renaming file index %s to %s", index, filename)
|
log.debug("renaming file index %s to %s", index, filename)
|
||||||
torrent_info.rename_file(index, utf8_encoded(filename))
|
torrent_info.rename_file(index, utf8_encoded(filename))
|
||||||
|
|
||||||
add_torrent_params["ti"] = torrent_info
|
add_torrent_params["ti"] = torrent_info
|
||||||
|
@ -856,9 +856,9 @@ class TorrentManager(component.Component):
|
||||||
log.debug("on_alert_torrent_finished")
|
log.debug("on_alert_torrent_finished")
|
||||||
try:
|
try:
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
torrent_id = str(alert.handle.info_hash())
|
|
||||||
log.debug("%s is finished..", torrent_id)
|
log.debug("%s is finished..", torrent_id)
|
||||||
|
|
||||||
# Get the total_download and if it's 0, do not move.. It's likely
|
# Get the total_download and if it's 0, do not move.. It's likely
|
||||||
|
@ -891,9 +891,9 @@ class TorrentManager(component.Component):
|
||||||
log.debug("on_alert_torrent_paused")
|
log.debug("on_alert_torrent_paused")
|
||||||
try:
|
try:
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
torrent_id = str(alert.handle.info_hash())
|
|
||||||
# Set the torrent state
|
# Set the torrent state
|
||||||
old_state = torrent.state
|
old_state = torrent.state
|
||||||
torrent.update_state()
|
torrent.update_state()
|
||||||
|
@ -985,9 +985,9 @@ class TorrentManager(component.Component):
|
||||||
log.debug("on_alert_torrent_resumed")
|
log.debug("on_alert_torrent_resumed")
|
||||||
try:
|
try:
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
torrent_id = str(alert.handle.info_hash())
|
|
||||||
torrent.is_finished = torrent.handle.is_seed()
|
torrent.is_finished = torrent.handle.is_seed()
|
||||||
old_state = torrent.state
|
old_state = torrent.state
|
||||||
torrent.update_state()
|
torrent.update_state()
|
||||||
|
@ -1012,10 +1012,8 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
def on_alert_save_resume_data(self, alert):
|
def on_alert_save_resume_data(self, alert):
|
||||||
log.debug("on_alert_save_resume_data")
|
log.debug("on_alert_save_resume_data")
|
||||||
|
|
||||||
torrent_id = str(alert.handle.info_hash())
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
torrent = self.torrents[torrent_id]
|
torrent = self.torrents[torrent_id]
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
@ -1046,9 +1044,9 @@ class TorrentManager(component.Component):
|
||||||
log.debug("index: %s name: %s", alert.index, alert.name.decode("utf8"))
|
log.debug("index: %s name: %s", alert.index, alert.name.decode("utf8"))
|
||||||
try:
|
try:
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
torrent_id = str(alert.handle.info_hash())
|
|
||||||
|
|
||||||
# We need to see if this file index is in a waiting_on_folder list
|
# We need to see if this file index is in a waiting_on_folder list
|
||||||
folder_rename = False
|
folder_rename = False
|
||||||
|
@ -1090,6 +1088,9 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
def on_alert_file_completed(self, alert):
|
def on_alert_file_completed(self, alert):
|
||||||
log.debug("file_completed_alert: %s", alert.message())
|
log.debug("file_completed_alert: %s", alert.message())
|
||||||
torrent_id = str(alert.handle.info_hash())
|
try:
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
|
except:
|
||||||
|
return
|
||||||
component.get("EventManager").emit(
|
component.get("EventManager").emit(
|
||||||
TorrentFileCompletedEvent(torrent_id, alert.index))
|
TorrentFileCompletedEvent(torrent_id, alert.index))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue