| Index: lib/subscriptionClasses.js |
| =================================================================== |
| --- a/lib/subscriptionClasses.js |
| +++ b/lib/subscriptionClasses.js |
| @@ -196,17 +196,17 @@ |
| if ("downloadStatus" in obj) |
| result._downloadStatus = obj.downloadStatus; |
| if ("lastSuccess" in obj) |
| - result.lastSuccess = parseInt(obj.lastSuccess) || 0; |
| + result.lastSuccess = parseInt(obj.lastSuccess, 10) || 0; |
| if ("lastCheck" in obj) |
| - result._lastCheck = parseInt(obj.lastCheck) || 0; |
| + result._lastCheck = parseInt(obj.lastCheck, 10) || 0; |
| if ("expires" in obj) |
| - result.expires = parseInt(obj.expires) || 0; |
| + result.expires = parseInt(obj.expires, 10) || 0; |
| if ("softExpiration" in obj) |
| - result.softExpiration = parseInt(obj.softExpiration) || 0; |
| + result.softExpiration = parseInt(obj.softExpiration, 10) || 0; |
| if ("errors" in obj) |
| - result._errors = parseInt(obj.errors) || 0; |
| + result._errors = parseInt(obj.errors, 10) || 0; |
| if ("version" in obj) |
| - result.version = parseInt(obj.version) || 0; |
| + result.version = parseInt(obj.version, 10) || 0; |
| if ("requiredVersion" in obj) |
| { |
| let {addonVersion} = require("info"); |
| @@ -217,7 +217,9 @@ |
| if ("homepage" in obj) |
| result._homepage = obj.homepage; |
| if ("lastDownload" in obj) |
| - result._lastDownload = parseInt(obj.lastDownload) || 0; |
| + result._lastDownload = parseInt(obj.lastDownload, 10) || 0; |
| + if ("downloadCount" in obj) |
| + result.downloadCount = parseInt(obj.downloadCount, 10) || 0; |
| } |
| catch (e) |
| { |
| @@ -560,6 +562,12 @@ |
| * @type Boolean |
| */ |
| upgradeRequired: false, |
| + |
| + /** |
| + * Number indicating how often the object was downloaded. |
| + * @type Number |
| + */ |
| + downloadCount: 0, |
| /** |
| * See Subscription.serialize() |
| @@ -583,5 +591,7 @@ |
| buffer.push("version=" + this.version); |
| if (this.requiredVersion) |
| buffer.push("requiredVersion=" + this.requiredVersion); |
| + if (this.downloadCount) |
| + buffer.push("downloadCount=" + this.downloadCount); |
| } |
| }; |