deluge file progress fix

pull/1/head
DiMartinoXBMC 2015-05-18 20:36:39 +03:00
parent 49a24bec2c
commit a25e598a4b
1 changed files with 4 additions and 0 deletions

View File

@ -912,6 +912,7 @@ class Deluge:
def listfiles(self, id): def listfiles(self, id):
obj = self.get_info() obj = self.get_info()
i=0
if obj is None: if obj is None:
return None return None
@ -939,8 +940,11 @@ class Deluge:
if x.get('progress'): if x.get('progress'):
percent=int(x['progress']*100) 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 else:percent=0
i+=1
res.append([path, percent, x['index'], size]) res.append([path, percent, x['index'], size])
return res return res