Fix the progress bars for directories, was calculating the progress incorrectly

This commit is contained in:
Damien Churchill 2010-03-23 23:45:52 +00:00
parent 4005003003
commit 73ec9b0338
1 changed files with 2 additions and 2 deletions

View File

@ -568,8 +568,8 @@ class WebApi(JSONComponent):
dirinfo["priority"] = 9
progresses = dirinfo.setdefault("progresses", [])
progresses.append(torrent_file["progress"])
dirinfo["progress"] = float(sum(progresses)) / len(progresses)
progresses.append(torrent_file["size"] * (torrent_file["progress"] / 100.0))
dirinfo["progress"] = float(sum(progresses)) / dirinfo["size"] * 100
dirinfo["path"] = dirname
dirname = os.path.dirname(dirname)