From a25e598a4be0d18c4b46646b69164fb4328a2122 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Mon, 18 May 2015 20:36:39 +0300 Subject: [PATCH] deluge file progress fix --- resources/utorrent/net.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/utorrent/net.py b/resources/utorrent/net.py index 4dc0adb..f59bfc3 100644 --- a/resources/utorrent/net.py +++ b/resources/utorrent/net.py @@ -912,6 +912,7 @@ class Deluge: def listfiles(self, id): obj = self.get_info() + i=0 if obj is None: return None @@ -939,8 +940,11 @@ class Deluge: if x.get('progress'): percent=int(x['progress']*100) + elif obj.get('file_progress') and len(obj['file_progress'])>=i: + percent=int(obj['file_progress'][i]*100) else:percent=0 + i+=1 res.append([path, percent, x['index'], size]) return res