Bug 1218317 - Retrieve the file size for finished downloads. r=margaret
MozReview-Commit-ID: 2TbC3rs0RyH
--- a/mobile/android/chrome/content/aboutDownloads.js
+++ b/mobile/android/chrome/content/aboutDownloads.js
@@ -325,17 +325,19 @@ DownloadItem.prototype = {
get id() {
return this._id;
},
get iconUrl() {
return this._iconUrl;
},
get size() {
- if (this.download.hasProgress) {
+ if (this.download.succeeded && this.download.target.exists) {
+ return DownloadUtils.convertByteUnits(this.download.target.size).join("");
+ } else if (this.download.hasProgress) {
return DownloadUtils.convertByteUnits(this.download.totalBytes).join("");
}
return strings.GetStringFromName("downloadState.unknownSize");
},
get startDate() {
return this._startDate;
},