From d7ddcb7ec4ffa59bedff11ee379b9fc776864bed Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 2 Jan 2022 15:22:58 +0100 Subject: [PATCH] Fix Tag --- src/main/java/de/chaos/swlnmngr/UpdateChecker.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/chaos/swlnmngr/UpdateChecker.java b/src/main/java/de/chaos/swlnmngr/UpdateChecker.java index 5f7bcd8..f85ee07 100644 --- a/src/main/java/de/chaos/swlnmngr/UpdateChecker.java +++ b/src/main/java/de/chaos/swlnmngr/UpdateChecker.java @@ -1,6 +1,7 @@ package de.chaos.swlnmngr; import de.chaos.swlnmngr.config.Config; +import lombok.experimental.UtilityClass; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; @@ -12,6 +13,7 @@ import org.json.JSONTokener; import java.io.IOException; import java.net.URI; +@UtilityClass public class UpdateChecker { private static final URI repoUrl = URI.create("https://steamwar.de/devlabs/api/v1/repos/Chaoscaot/SteamwarLinkManager/releases?draft=false&pre-release=" + Config.PRE_RELEASES + "&page=1&limit=1"); @@ -34,7 +36,7 @@ public class UpdateChecker { try (CloseableHttpResponse response = client.execute(get)) { JSONArray array = new JSONArray(new JSONTokener(response.getEntity().getContent())); JSONObject latestObject = array.getJSONObject(0); - String latestVersion = latestObject.getString("name"); + String latestVersion = latestObject.getString("tag_name"); if(!latestVersion.equals(CURRENT_VERSION)) { Main.getLogger().info("The Running Jar is not the Latest release Version\n\tYour Version: {}\n\tLatest Release Version: {}", CURRENT_VERSION, latestVersion); Main.getLogger().info("Download the Latest Jar here: https://steamwar.de/devlabs/Chaoscaot/SteamwarLinkManager/releases"); @@ -44,8 +46,4 @@ public class UpdateChecker { Main.getLogger().error("Could not fetch Updates", e); } } - - public static void update() { - - } }