Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Disable update checker for new updater temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed Apr 28, 2024
1 parent 7ced328 commit d26f5c1
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,29 @@ public ScheduledExecutorService getExecutor() {
}

public void run() {
i++; u++;
i++;
if(!started) {
started = true;
return;
}
try {
JsonObject json = new Gson().fromJson(GsonUtil.getFromURL("https://raw.githubusercontent.com/danieldieeins/ZyneonApplicationContent/main/l/application.json"), JsonObject.class);
if(u>119) {
u = 0;
if(!Main.isTest()) {
Main.getLogger().debug("[RUNNER] Checking for Updates...");
Main.getLogger().debug("[RUNNER] Parsed JSON Data...");
String v = json.get("updater").getAsJsonObject().get("version").getAsString();
Main.getLogger().debug("[RUNNER] Latest version: " + v + "...");
Main.getLogger().debug("[RUNNER] Current version: " + version + "...");
if (!v.equals(version)) {
Main.getLogger().debug("[RUNNER] Saving new information...");
Main.getLogger().debug("[RUNNER] Sending notification...");
Application.getFrame().sendNotification("Update available!", "Version " + v + " has been released!", "<a onclick=\"callJavaMethod('button.exit');\" class='button'>Install</a><a onclick=\"callJavaMethod('button.online');\" class='button'>Dynamic update</a>", v, true);
Main.getLogger().debug("[RUNNER] The application is not up to date!");
if(Application.updateChannel.equalsIgnoreCase("old")) {
u++;
if (u > 119) {
u = 0;
if (!Main.isTest()) {
Main.getLogger().debug("[RUNNER] Checking for Updates...");
Main.getLogger().debug("[RUNNER] Parsed JSON Data...");
String v = json.get("updater").getAsJsonObject().get("version").getAsString();
Main.getLogger().debug("[RUNNER] Latest version: " + v + "...");
Main.getLogger().debug("[RUNNER] Current version: " + version + "...");
if (!v.equals(version)) {
Main.getLogger().debug("[RUNNER] Saving new information...");
Main.getLogger().debug("[RUNNER] Sending notification...");
Application.getFrame().sendNotification("Update available!", "Version " + v + " has been released!", "<a onclick=\"callJavaMethod('button.exit');\" class='button'>Install</a><a onclick=\"callJavaMethod('button.online');\" class='button'>Dynamic update</a>", v, true);
Main.getLogger().debug("[RUNNER] The application is not up to date!");
}
}
}
}
Expand Down

0 comments on commit d26f5c1

Please sign in to comment.