summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2011-09-25 18:14:33 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2011-11-20 17:58:29 +0000
commit683e4be529b5d45e961abfc5530b0676e8ad9a8b (patch)
tree4002ca06a0e728390984dd02e433afc05f083eeb
parent93a860f2a1beb4ff28e20f48f8038dc6f33280e0 (diff)
downloaddeluge-683e4be5.zip
deluge-683e4be5.tar.gz
deluge-683e4be5.tar.bz2
Fix #1940 : File & folder renaming issue when using Add Torrent dialog in Windows
The file rename in torrentmanager was calling lt.rename_file directly so skipping the sanitize function normally applied when renaming.
-rw-r--r--deluge/core/torrentmanager.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index a14e715..545959c 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -417,9 +417,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, name in options["mapped_files"].items():
- log.debug("renaming file index %s to %s", index, name)
- torrent_info.rename_file(index, utf8_encoded(name))
+ 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))
add_torrent_params["ti"] = torrent_info
add_torrent_params["resume_data"] = ""