Remove unused settings and have a better default
This commit is contained in:
parent
f2bab07bfb
commit
7c4ad5543c
|
@ -290,10 +290,6 @@ public class MangaDexClient {
|
||||||
if (settings.getWebSettings().getUiPort() == 0) {
|
if (settings.getWebSettings().getUiPort() == 0) {
|
||||||
MangaDexClient.dieWithError("Config Error: Invalid UI port number");
|
MangaDexClient.dieWithError("Config Error: Invalid UI port number");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.getWebSettings().getUiWebsocketPort() == 0) {
|
|
||||||
MangaDexClient.dieWithError("Config Error: Invalid websocket port number");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public final class ClientSettings {
|
||||||
this.clientPort = 1200;
|
this.clientPort = 1200;
|
||||||
this.clientSecret = "PASTE-YOUR-SECRET-HERE";
|
this.clientSecret = "PASTE-YOUR-SECRET-HERE";
|
||||||
this.threads = 32;
|
this.threads = 32;
|
||||||
this.webSettings = new WebSettings();
|
this.webSettings = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientSettings(long maxCacheSizeMib, long maxBandwidthMibPerHour, long maxBurstRateKibPerSecond,
|
public ClientSettings(long maxCacheSizeMib, long maxBandwidthMibPerHour, long maxBurstRateKibPerSecond,
|
||||||
|
|
|
@ -3,31 +3,25 @@ package mdnet.base.settings;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public final class WebSettings {
|
public final class WebSettings {
|
||||||
@SerializedName("ui_websocket_port")
|
|
||||||
private final int uiWebsocketPort;
|
|
||||||
@SerializedName("ui_port")
|
@SerializedName("ui_port")
|
||||||
private final int uiPort;
|
private final int uiPort;
|
||||||
|
|
||||||
public WebSettings() {
|
public WebSettings() {
|
||||||
this.uiWebsocketPort = 33333;
|
|
||||||
this.uiPort = 8080;
|
this.uiPort = 8080;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebSettings(int uiWebsocketPort, int uiPort) {
|
public WebSettings(int uiPort) {
|
||||||
this.uiWebsocketPort = uiWebsocketPort;
|
|
||||||
this.uiPort = uiPort;
|
this.uiPort = uiPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUiWebsocketPort() {
|
|
||||||
return uiWebsocketPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getUiPort() {
|
public int getUiPort() {
|
||||||
return uiPort;
|
return uiPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "WebSettings{" + "uiWebsocketPort=" + uiWebsocketPort + ", uiPort=" + uiPort + '}';
|
return "WebSettings{" +
|
||||||
|
"uiPort=" + uiPort +
|
||||||
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue