diff --git a/build.gradle b/build.gradle index a4ddbed3..f3ef842f 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ plugins { } group = 'online.hatsunemiku' -version = '1.3.0' +version = '1.4.0' sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 diff --git a/src/main/java/online/hatsunemiku/tachideskvaadinui/startup/TachideskMaintainer.java b/src/main/java/online/hatsunemiku/tachideskvaadinui/startup/TachideskMaintainer.java index 88101bc1..c6b76006 100644 --- a/src/main/java/online/hatsunemiku/tachideskvaadinui/startup/TachideskMaintainer.java +++ b/src/main/java/online/hatsunemiku/tachideskvaadinui/startup/TachideskMaintainer.java @@ -205,7 +205,7 @@ private void checkServerConfig() { private static void deleteOldServerFile(Meta oldServer) { - if (!oldServer.getJarLocation().isEmpty()) { + if (oldServer.getJarLocation().isEmpty()) { return; } diff --git a/src/main/java/online/hatsunemiku/tachideskvaadinui/utils/TachideskUtils.java b/src/main/java/online/hatsunemiku/tachideskvaadinui/utils/TachideskUtils.java index e2a7c062..751247f7 100644 --- a/src/main/java/online/hatsunemiku/tachideskvaadinui/utils/TachideskUtils.java +++ b/src/main/java/online/hatsunemiku/tachideskvaadinui/utils/TachideskUtils.java @@ -21,11 +21,10 @@ public class TachideskUtils { private static final Logger logger = LoggerFactory.getLogger(TachideskUtils.class); private static final Pattern JAR_PATTERN = Pattern.compile( - "https://github\\.com/Suwayomi/Suwayomi-Server-preview/releases/download/v\\d+\\.\\d+\\.\\d+-r\\d+/(Suwayomi-Server-v(\\d+\\.\\d+\\.\\d+)-r(\\d+)\\.jar)"); + "https://github\\.com/Suwayomi/Suwayomi-Server/releases/download/(v\\d+\\.\\d+\\.\\d+(-r\\d+)?)/(Suwayomi-Server-v\\d+\\.\\d+\\.\\d+-r(\\d+)\\.jar)"); public static String getNewestJarUrl(RestTemplate client) { - String githubApi = - "https://api.github.com/repos/Suwayomi/Suwayomi-Server-preview/releases/latest"; + String githubApi = "https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest"; String json = client.getForObject(githubApi, String.class); if (json == null) { @@ -54,9 +53,9 @@ public static Optional getMetaFromUrl(String url) { Meta meta = new Meta(); - meta.setJarVersion(matcher.group(2)); - meta.setJarRevision(matcher.group(3)); - meta.setJarName(matcher.group(1)); + meta.setJarVersion(matcher.group(1)); + meta.setJarRevision(matcher.group(4)); + meta.setJarName(matcher.group(3)); return Optional.of(meta); }