summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2012-12-05 13:41:30 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2012-12-09 23:22:30 +0000
commit74208c27f8bbd03045ea74f9f9f136372ea08444 (patch)
treef9189949186cfe3bca123149c7e58e4da9cd4c2d
parent7cc8243849e0273316cb8dd1c863d9980a3edd20 (diff)
downloaddeluge-74208c27f8bbd03045ea74f9f9f136372ea08444.zip
deluge-74208c27f8bbd03045ea74f9f9f136372ea08444.tar.gz
deluge-74208c27f8bbd03045ea74f9f9f136372ea08444.tar.bz2
Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex
-rw-r--r--deluge/ui/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/deluge/ui/common.py b/deluge/ui/common.py
index 08504be..59ae5fa 100644
--- a/deluge/ui/common.py
+++ b/deluge/ui/common.py
@@ -104,8 +104,11 @@ class TorrentInfo(object):
else:
path = decode_string(os.path.join(prefix, decode_string(os.path.join(*f["path"]), self.encoding)), self.encoding)
f["index"] = index
+ if "sha1" in f and len(f["sha1"]) == 20:
+ f["sha1"] = f["sha1"].encode('hex')
+ if "ed2k" in f and len(f["ed2k"]) == 16:
+ f["ed2k"] = f["ed2k"].encode('hex')
paths[path] = f
-
dirname = os.path.dirname(path)
while dirname:
dirinfo = dirs.setdefault(dirname, {})