mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 17:47:38 +01:00
[New] Implemented update check setting
Setting: Plugin.Check-for-updates Affected issues: #751
This commit is contained in:
parent
0b7198df07
commit
6a8f93be89
@ -31,6 +31,7 @@ public enum Settings implements Setting {
|
||||
DISPLAY_GAPS_IN_GRAPH_DATA("Customization.Display.GapsInGraphData"),
|
||||
DATA_GEOLOCATIONS("Data.Geolocations"),
|
||||
NOTIFY_ABOUT_DEV_RELEASES("Plugin.Notify-About-DEV-Releases"),
|
||||
CHECK_FOR_UPDATES("Plugin.Check-for-updates"),
|
||||
|
||||
// Integer
|
||||
WEBSERVER_PORT("WebServer.Port"),
|
||||
|
@ -18,6 +18,7 @@ import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -54,6 +55,9 @@ public class VersionCheckSystem implements SubSystem {
|
||||
|
||||
@Override
|
||||
public void enable() {
|
||||
if (config.isFalse(Settings.CHECK_FOR_UPDATES)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
List<VersionInfo> versions = VersionInfoLoader.load();
|
||||
if (config.isFalse(Settings.NOTIFY_ABOUT_DEV_RELEASES)) {
|
||||
@ -83,7 +87,7 @@ public class VersionCheckSystem implements SubSystem {
|
||||
/* Does not need to be closed */
|
||||
}
|
||||
|
||||
public VersionInfo getNewVersionAvailable() {
|
||||
return newVersionAvailable;
|
||||
public Optional<VersionInfo> getNewVersionAvailable() {
|
||||
return Optional.ofNullable(newVersionAvailable);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ Network:
|
||||
Plugin:
|
||||
Debug: 'false'
|
||||
Locale: default
|
||||
Check-for-updates: true
|
||||
Notify-About-DEV-Releases: false
|
||||
KeepLogsForXDays: 7
|
||||
|
||||
|
@ -17,6 +17,7 @@ Plugin:
|
||||
Bungee-Override:
|
||||
StandaloneMode: false
|
||||
CopyBungeeConfig: true
|
||||
Check-for-updates: true
|
||||
Notify-About-DEV-Releases: false
|
||||
KeepLogsForXDays: 7
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user