Changelog field

This commit is contained in:
Minecon724 2024-10-27 16:08:53 +01:00
parent 3d03c2479b
commit 0159565bf1
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 18 additions and 8 deletions

View file

@ -33,7 +33,7 @@ public class SimpleDownloader implements Downloader {
HttpRequest request = HttpRequest.newBuilder() HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url)) .uri(URI.create(url))
.header("User-Agent", "rwu/1") // real weather updater v1 .header("User-Agent", "ju/1") // jar updater v1
.build(); .build();
CompletableFuture<HttpResponse<InputStream>> responseFuture = CompletableFuture<HttpResponse<InputStream>> responseFuture =

View file

@ -8,20 +8,23 @@ public class Version {
*/ */
public static final int SPEC = 1; public static final int SPEC = 1;
public Version(int id, long timestamp, String label, String fileUrl, String sha256) { public Version(int id, long timestamp, String label, String fileUrl, String changelogUrl, String sha256) {
this.id = id; this.id = id;
this.timestamp = timestamp; this.timestamp = timestamp;
this.label = label; this.label = label;
this.fileUrl = fileUrl; this.fileUrl = fileUrl;
this.changelogUrl = changelogUrl;
this.sha256 = sha256; this.sha256 = sha256;
} }
private int id; private final int id;
private long timestamp; private final long timestamp;
private String label; private final String label;
@SerializedName("file") @SerializedName("file")
private String fileUrl; private final String fileUrl;
private String sha256; @SerializedName("changelog")
private final String changelogUrl;
private final String sha256;
/** /**
* version id. increments with each version * version id. increments with each version
@ -38,7 +41,7 @@ public class Version {
} }
/** /**
* label aka version string * label aka version string<br>
* example: 1.0.0 * example: 1.0.0
*/ */
public String getLabel() { public String getLabel() {
@ -52,6 +55,13 @@ public class Version {
return fileUrl; return fileUrl;
} }
/**
* url of changelog file
*/
public String getChangelogUrl() {
return changelogUrl;
}
/** /**
* sha256 hash of that file * sha256 hash of that file
*/ */