From b23e7afc159c0af913945ceae669345647c5eb40 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 10 Jul 2016 19:39:08 +0800 Subject: [PATCH] fix sometimes health percentage is incorrect --- src/scripts/services/aria2TaskService.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/scripts/services/aria2TaskService.js b/src/scripts/services/aria2TaskService.js index 957cb18..94c7b76 100644 --- a/src/scripts/services/aria2TaskService.js +++ b/src/scripts/services/aria2TaskService.js @@ -498,14 +498,11 @@ } var totalPieces = []; - var currentPieces = getPieceStatus(task.bitfield, task.numPieces); var maxCompletedPieceCount = 0; var maxCompletedPercent = task.completePercent; - for (var i = 0; i < currentPieces.length; i++) { - var count = currentPieces[i] ? 1 : 0; - totalPieces.push(count); - maxCompletedPieceCount += count; + for (var i = 0; i < task.numPieces; i++) { + totalPieces.push(0); } for (var i = 0; i < peers.length; i++) {