From 6f98e1fddb9d39a50a7cd86f087ff0f338e2fb94 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 21 Aug 2012 18:30:53 -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 24a3dfbc8..b3c6d4cba 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -451,10 +451,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