Commit 182439fa authored by mercury233's avatar mercury233

fix download progress

parent 14ab6ac3
...@@ -54,11 +54,10 @@ export class DownloadStatus { ...@@ -54,11 +54,10 @@ export class DownloadStatus {
status.errorCode = o.errorCode; status.errorCode = o.errorCode;
status.errorMessage = o.errorMessage; status.errorMessage = o.errorMessage;
} }
status.downloadSpeed += o.downloadSpeed;
status.totalLength += o.totalLength;
status.completedLength += o.completedLength;
} }
status.downloadSpeed += o.downloadSpeed;
status.totalLength += o.totalLength;
status.completedLength += o.completedLength;
} }
return status; return status;
} }
...@@ -79,7 +78,7 @@ export class DownloadStatus { ...@@ -79,7 +78,7 @@ export class DownloadStatus {
if (item) { if (item) {
this.completedLength = parseInt(item.completedLength) || 0; this.completedLength = parseInt(item.completedLength) || 0;
this.downloadSpeed = parseInt(item.downloadSpeed) || 0; this.downloadSpeed = parseInt(item.downloadSpeed) || 0;
this.totalLength = parseInt(item.totalLength) || 0; this.totalLength = parseInt(item.totalLength) || parseInt(item.files[0].length) || 0;
this.gid = item.gid; this.gid = item.gid;
this.status = item.status; this.status = item.status;
this.errorCode = item.errorCode; this.errorCode = item.errorCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment