Index: lib/subscriptionClasses.js |
=================================================================== |
--- a/lib/subscriptionClasses.js |
+++ b/lib/subscriptionClasses.js |
@@ -47,16 +47,22 @@ |
{ |
/** |
* Download location of the subscription |
* @type {string} |
*/ |
url: null, |
/** |
+ * Type of the subscription |
+ * @type {?string} |
+ */ |
+ type: null, |
+ |
+ /** |
* Filters contained in the filter subscription |
* @type {Filter[]} |
*/ |
filters: null, |
_title: null, |
_fixedTitle: false, |
_disabled: false, |
@@ -125,16 +131,18 @@ |
* Serializes the subscription to an array of strings for writing |
* out on the disk. |
* @param {string[]} buffer buffer to push the serialization results into |
*/ |
serialize(buffer) |
{ |
buffer.push("[Subscription]"); |
buffer.push("url=" + this.url); |
+ if (this.type) |
+ buffer.push("type=" + this.type); |
if (this._title) |
buffer.push("title=" + this._title); |
if (this._fixedTitle) |
buffer.push("fixedTitle=true"); |
if (this._disabled) |
buffer.push("disabled=true"); |
}, |
@@ -186,16 +194,18 @@ |
*/ |
Subscription.fromObject = function(obj) |
{ |
let result; |
if (obj.url[0] != "~") |
{ |
// URL is valid - this is a downloadable subscription |
result = new DownloadableSubscription(obj.url, obj.title); |
+ if ("type" in obj) |
+ result.type = obj.type; |
if ("downloadStatus" in obj) |
result._downloadStatus = obj.downloadStatus; |
if ("lastSuccess" in obj) |
result.lastSuccess = parseInt(obj.lastSuccess, 10) || 0; |
if ("lastCheck" in obj) |
result._lastCheck = parseInt(obj.lastCheck, 10) || 0; |
if ("expires" in obj) |
result.expires = parseInt(obj.expires, 10) || 0; |