Skip to content

Commit

Permalink
Merge pull request #99 from Suwayomi/Updater-update
Browse files Browse the repository at this point in the history
Update the Server download/updating process
  • Loading branch information
aless2003 authored Feb 24, 2024
2 parents 82a2744 + 8819f9f commit 6388a7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
}

group = 'online.hatsunemiku'
version = '1.3.0'
version = '1.4.0'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private void checkServerConfig() {

private static void deleteOldServerFile(Meta oldServer) {

if (!oldServer.getJarLocation().isEmpty()) {
if (oldServer.getJarLocation().isEmpty()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -54,9 +53,9 @@ public static Optional<Meta> 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);
}
Expand Down

0 comments on commit 6388a7c

Please sign in to comment.