|
@@ -39,6 +39,7 @@ public class AddonInfo {
|
39
|
39
|
private final int id;
|
40
|
40
|
private final String stableDownload;
|
41
|
41
|
private final String unstableDownload;
|
|
42
|
+ private final String nightlyDownload;
|
42
|
43
|
private final String title;
|
43
|
44
|
private final String author;
|
44
|
45
|
private final int rating;
|
|
@@ -61,8 +62,9 @@ public class AddonInfo {
|
61
|
62
|
this.type = entry.get("type").equals("plugin") ?
|
62
|
63
|
AddonType.TYPE_PLUGIN : entry.get("type").equals("theme") ?
|
63
|
64
|
AddonType.TYPE_THEME : AddonType.TYPE_ACTION_PACK;
|
64
|
|
- this.stableDownload = entry.get("stable");
|
65
|
|
- this.unstableDownload = entry.get("unstable");
|
|
65
|
+ this.stableDownload = entry.containsKey("stable") ? entry.get("stable") : "";
|
|
66
|
+ this.unstableDownload = entry.containsKey("unstable") ? entry.get("unstable") : "";
|
|
67
|
+ this.nightlyDownload = entry.containsKey("nightly") ? entry.get("nightly") : "";
|
66
|
68
|
this.description = entry.get("description");
|
67
|
69
|
this.verified = entry.get("verified").equals("yes");
|
68
|
70
|
this.date = Integer.parseInt(entry.get("date"));
|
|
@@ -158,6 +160,15 @@ public class AddonInfo {
|
158
|
160
|
return unstableDownload;
|
159
|
161
|
}
|
160
|
162
|
|
|
163
|
+ /**
|
|
164
|
+ * Returns the nightly download location.
|
|
165
|
+ *
|
|
166
|
+ * @return Nightly download location
|
|
167
|
+ */
|
|
168
|
+ public String getNightlyDownload() {
|
|
169
|
+ return nightlyDownload;
|
|
170
|
+ }
|
|
171
|
+
|
161
|
172
|
/**
|
162
|
173
|
* Returns whether the addon is verified.
|
163
|
174
|
*
|
|
@@ -201,8 +212,10 @@ public class AddonInfo {
|
201
|
212
|
getOption("updater", "channel");
|
202
|
213
|
if ("STABLE".equals(channel)) {
|
203
|
214
|
return !stableDownload.isEmpty();
|
204
|
|
- } else {
|
|
215
|
+ } else if ("UNSTABLE".equals(channel)) {
|
205
|
216
|
return !unstableDownload.isEmpty();
|
|
217
|
+ } else {
|
|
218
|
+ return !nightlyDownload.isEmpty();
|
206
|
219
|
}
|
207
|
220
|
}
|
208
|
221
|
|