From 3569e187122af537ced45c2ccfa1c985e6fd7186 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 21 Aug 2012 18:31:59 -0700 Subject: [PATCH] Don't clobber filename when adding torrents with mapped_files --- deluge/core/torrentmanager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index a378a2255..275c1852f 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -418,10 +418,10 @@ class TorrentManager(component.Component): # Check for renamed files and if so, rename them in the torrent_info # before adding to the session. if options["mapped_files"]: - for index, filename in options["mapped_files"].items(): - filename = deluge.core.torrent.sanitize_filepath(filename) - log.debug("renaming file index %s to %s", index, filename) - torrent_info.rename_file(index, utf8_encoded(filename)) + for index, fname in options["mapped_files"].items(): + fname = deluge.core.torrent.sanitize_filepath(fname) + log.debug("renaming file index %s to %s", index, fname) + torrent_info.rename_file(index, utf8_encoded(fname)) add_torrent_params["ti"] = torrent_info add_torrent_params["resume_data"] = ""