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:
Andrew Resch 2009-06-23 17:36:01 +00:00
parent a29904fefd
commit 148afede5b
1 changed files with 7 additions and 0 deletions

View File

@ -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] != "/":