Calum Lind : Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex

0 views
Skip to first unread message

g...@deluge-torrent.org

unread,
Dec 9, 2012, 6:24:02 PM12/9/12
to deluge...@googlegroups.com
Module: deluge
Branch: master
Commit: 8658be3b05fc7ee2c74e35bd204398ba46988e22

Author: Calum Lind <calumlin...@gmail.com>
Date: Wed Dec 5 13:41:30 2012 +0000

Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex

---

deluge/ui/common.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/deluge/ui/common.py b/deluge/ui/common.py
index 3b754ce..64c0b61 100644
--- a/deluge/ui/common.py
+++ b/deluge/ui/common.py
@@ -106,8 +106,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, {})

g...@deluge-torrent.org

unread,
Dec 9, 2012, 6:24:02 PM12/9/12
to deluge...@googlegroups.com
Module: deluge
Branch: 1.3-stable
Commit: 74208c27f8bbd03045ea74f9f9f136372ea08444

Author: Calum Lind <calumlin...@gmail.com>
Date: Wed Dec 5 13:41:30 2012 +0000

Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex

---

deluge/ui/common.py | 5 ++++-
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):
Reply all
Reply to author
Forward
0 new messages