mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 03:54:50 +00:00
Check to see if the files_list for the torrent_id is available when receiving file_renamed or
folder_renamed events
This commit is contained in:
parent
a29904fefd
commit
148afede5b
1 changed files with 7 additions and 0 deletions
|
@ -557,6 +557,10 @@ class FilesTab(Tab):
|
|||
|
||||
def _on_torrentfilerenamed_event(self, torrent_id, index, name):
|
||||
log.debug("index: %s name: %s", index, name)
|
||||
|
||||
if torrent_id not in self.files_list:
|
||||
return
|
||||
|
||||
old_name = self.files_list[torrent_id][index]["path"]
|
||||
self.files_list[torrent_id][index]["path"] = name
|
||||
|
||||
|
@ -705,6 +709,9 @@ class FilesTab(Tab):
|
|||
log.debug("on_torrent_folder_renamed_signal")
|
||||
log.debug("old_folder: %s new_folder: %s", old_folder, new_folder)
|
||||
|
||||
if torrent_id not in self.files_list:
|
||||
return
|
||||
|
||||
if old_folder[-1] != "/":
|
||||
old_folder += "/"
|
||||
if new_folder[-1] != "/":
|
||||
|
|
Loading…
Add table
Reference in a new issue