Don't clobber filename when adding torrents with mapped_files

This commit is contained in:
Andrew Resch 2012-08-21 18:30:53 -07:00
parent d3f6616d5d
commit 6f98e1fddb
1 changed files with 4 additions and 4 deletions

View File

@ -451,10 +451,10 @@ class TorrentManager(component.Component):
# Check for renamed files and if so, rename them in the torrent_info # Check for renamed files and if so, rename them in the torrent_info
# before adding to the session. # before adding to the session.
if options["mapped_files"]: if options["mapped_files"]:
for index, filename in options["mapped_files"].items(): for index, fname in options["mapped_files"].items():
filename = deluge.core.torrent.sanitize_filepath(filename) fname = deluge.core.torrent.sanitize_filepath(fname)
log.debug("renaming file index %s to %s", index, filename) log.debug("renaming file index %s to %s", index, fname)
torrent_info.rename_file(index, utf8_encoded(filename)) torrent_info.rename_file(index, utf8_encoded(fname))
add_torrent_params["ti"] = torrent_info add_torrent_params["ti"] = torrent_info