Don't clobber filename when adding torrents with mapped_files

This commit is contained in:
Andrew Resch 2012-08-21 18:31:59 -07:00
parent 42118932f2
commit 3569e18712
1 changed files with 4 additions and 4 deletions

View File

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