From 7c4ad5543c9978492e64e3c24aae2ce71838b9c2 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Sat, 13 Jun 2020 17:20:34 -0500 Subject: [PATCH] Remove unused settings and have a better default --- src/main/java/mdnet/base/MangaDexClient.java | 4 ---- .../java/mdnet/base/settings/ClientSettings.java | 2 +- src/main/java/mdnet/base/settings/WebSettings.java | 14 ++++---------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/mdnet/base/MangaDexClient.java b/src/main/java/mdnet/base/MangaDexClient.java index f1f1bb7..d16aa60 100644 --- a/src/main/java/mdnet/base/MangaDexClient.java +++ b/src/main/java/mdnet/base/MangaDexClient.java @@ -290,10 +290,6 @@ public class MangaDexClient { if (settings.getWebSettings().getUiPort() == 0) { MangaDexClient.dieWithError("Config Error: Invalid UI port number"); } - - if (settings.getWebSettings().getUiWebsocketPort() == 0) { - MangaDexClient.dieWithError("Config Error: Invalid websocket port number"); - } } } diff --git a/src/main/java/mdnet/base/settings/ClientSettings.java b/src/main/java/mdnet/base/settings/ClientSettings.java index 9c628a7..9ef0207 100644 --- a/src/main/java/mdnet/base/settings/ClientSettings.java +++ b/src/main/java/mdnet/base/settings/ClientSettings.java @@ -27,7 +27,7 @@ public final class ClientSettings { this.clientPort = 1200; this.clientSecret = "PASTE-YOUR-SECRET-HERE"; this.threads = 32; - this.webSettings = new WebSettings(); + this.webSettings = null; } public ClientSettings(long maxCacheSizeMib, long maxBandwidthMibPerHour, long maxBurstRateKibPerSecond, diff --git a/src/main/java/mdnet/base/settings/WebSettings.java b/src/main/java/mdnet/base/settings/WebSettings.java index 03ea12d..51edb51 100644 --- a/src/main/java/mdnet/base/settings/WebSettings.java +++ b/src/main/java/mdnet/base/settings/WebSettings.java @@ -3,31 +3,25 @@ package mdnet.base.settings; import com.google.gson.annotations.SerializedName; public final class WebSettings { - @SerializedName("ui_websocket_port") - private final int uiWebsocketPort; @SerializedName("ui_port") private final int uiPort; public WebSettings() { - this.uiWebsocketPort = 33333; this.uiPort = 8080; } - public WebSettings(int uiWebsocketPort, int uiPort) { - this.uiWebsocketPort = uiWebsocketPort; + public WebSettings(int uiPort) { this.uiPort = uiPort; } - public int getUiWebsocketPort() { - return uiWebsocketPort; - } - public int getUiPort() { return uiPort; } @Override public String toString() { - return "WebSettings{" + "uiWebsocketPort=" + uiWebsocketPort + ", uiPort=" + uiPort + '}'; + return "WebSettings{" + + "uiPort=" + uiPort + + '}'; } }