parent
e369d7e143
commit
09ad2aacb6
|
@ -1,7 +1,6 @@
|
||||||
package ctbrec.ui;
|
package ctbrec.ui;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import ctbrec.Config;
|
import ctbrec.Config;
|
||||||
import ctbrec.Model;
|
import ctbrec.Model;
|
||||||
|
@ -15,7 +14,6 @@ import ctbrec.image.LocalPortraitStore;
|
||||||
import ctbrec.image.PortraitStore;
|
import ctbrec.image.PortraitStore;
|
||||||
import ctbrec.image.RemotePortraitStore;
|
import ctbrec.image.RemotePortraitStore;
|
||||||
import ctbrec.io.*;
|
import ctbrec.io.*;
|
||||||
import ctbrec.io.json.ObjectMapperFactory;
|
|
||||||
import ctbrec.notes.LocalModelNotesService;
|
import ctbrec.notes.LocalModelNotesService;
|
||||||
import ctbrec.notes.ModelNotesService;
|
import ctbrec.notes.ModelNotesService;
|
||||||
import ctbrec.notes.RemoteModelNotesService;
|
import ctbrec.notes.RemoteModelNotesService;
|
||||||
|
@ -62,7 +60,6 @@ import javafx.scene.paint.Color;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.WindowEvent;
|
import javafx.stage.WindowEvent;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import okhttp3.Request;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -131,9 +128,6 @@ public class CamrecApplication extends Application {
|
||||||
createPortraitStore();
|
createPortraitStore();
|
||||||
createModelNotesService();
|
createModelNotesService();
|
||||||
createGui(primaryStage);
|
createGui(primaryStage);
|
||||||
if (config.getSettings().checkForUpdates) {
|
|
||||||
checkForUpdates();
|
|
||||||
}
|
|
||||||
registerClipboardListener();
|
registerClipboardListener();
|
||||||
registerTrayIconListener();
|
registerTrayIconListener();
|
||||||
}
|
}
|
||||||
|
@ -603,37 +597,6 @@ public class CamrecApplication extends Application {
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkForUpdates() {
|
|
||||||
var updateCheck = new Thread(() -> {
|
|
||||||
var url = "https://pastebin.com/raw/mUxtKzyB";
|
|
||||||
var request = new Request.Builder().url(url).build();
|
|
||||||
try (var response = httpClient.execute(request)) {
|
|
||||||
var body = response.body().string();
|
|
||||||
LOG.trace("Version check respone: {}", body);
|
|
||||||
if (response.isSuccessful()) {
|
|
||||||
List<Release> releases = ObjectMapperFactory.getMapper().readValue(body, new TypeReference<>() {
|
|
||||||
});
|
|
||||||
var latest = releases.get(0);
|
|
||||||
var latestVersion = latest.getVersion();
|
|
||||||
var ctbrecVersion = Version.getVersion();
|
|
||||||
if (latestVersion.compareTo(ctbrecVersion) > 0) {
|
|
||||||
LOG.debug("Update available {} < {}", ctbrecVersion, latestVersion);
|
|
||||||
Platform.runLater(() -> tabPane.getTabs().add(new UpdateTab(latest)));
|
|
||||||
} else {
|
|
||||||
LOG.debug("ctbrec is up-to-date {}", ctbrecVersion);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw new HttpException(response.code(), response.message());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Update check failed: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
updateCheck.setName("Update Check");
|
|
||||||
updateCheck.setDaemon(true);
|
|
||||||
updateCheck.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Release {
|
public static class Release {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -128,7 +128,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
private SimpleLongProperty recordUntilDefaultDurationInMinutes;
|
private SimpleLongProperty recordUntilDefaultDurationInMinutes;
|
||||||
private SimpleStringProperty dateTimeFormat;
|
private SimpleStringProperty dateTimeFormat;
|
||||||
private final VariablePlayGroundDialogFactory variablePlayGroundDialogFactory = new VariablePlayGroundDialogFactory();
|
private final VariablePlayGroundDialogFactory variablePlayGroundDialogFactory = new VariablePlayGroundDialogFactory();
|
||||||
private SimpleBooleanProperty checkForUpdates;
|
|
||||||
private SimpleStringProperty filterBlacklist;
|
private SimpleStringProperty filterBlacklist;
|
||||||
private SimpleStringProperty filterWhitelist;
|
private SimpleStringProperty filterWhitelist;
|
||||||
private SimpleBooleanProperty deleteOrphanedRecordingMetadata;
|
private SimpleBooleanProperty deleteOrphanedRecordingMetadata;
|
||||||
|
@ -210,7 +209,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
recordUntilDefaultDurationInMinutes = new SimpleLongProperty(null, "recordUntilDefaultDurationInMinutes", settings.recordUntilDefaultDurationInMinutes);
|
recordUntilDefaultDurationInMinutes = new SimpleLongProperty(null, "recordUntilDefaultDurationInMinutes", settings.recordUntilDefaultDurationInMinutes);
|
||||||
dateTimeFormat = new SimpleStringProperty(null, "dateTimeFormat", settings.dateTimeFormat);
|
dateTimeFormat = new SimpleStringProperty(null, "dateTimeFormat", settings.dateTimeFormat);
|
||||||
tabsSortable = new SimpleBooleanProperty(null, "tabsSortable", settings.tabsSortable);
|
tabsSortable = new SimpleBooleanProperty(null, "tabsSortable", settings.tabsSortable);
|
||||||
checkForUpdates = new SimpleBooleanProperty(null, "checkForUpdates", settings.checkForUpdates);
|
|
||||||
filterBlacklist = new SimpleStringProperty(null, "filterBlacklist", settings.filterBlacklist);
|
filterBlacklist = new SimpleStringProperty(null, "filterBlacklist", settings.filterBlacklist);
|
||||||
filterWhitelist = new SimpleStringProperty(null, "filterWhitelist", settings.filterWhitelist);
|
filterWhitelist = new SimpleStringProperty(null, "filterWhitelist", settings.filterWhitelist);
|
||||||
deleteOrphanedRecordingMetadata = new SimpleBooleanProperty(null, "deleteOrphanedRecordingMetadata", settings.deleteOrphanedRecordingMetadata);
|
deleteOrphanedRecordingMetadata = new SimpleBooleanProperty(null, "deleteOrphanedRecordingMetadata", settings.deleteOrphanedRecordingMetadata);
|
||||||
|
@ -245,7 +243,6 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(),
|
Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(),
|
||||||
Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"),
|
Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"),
|
||||||
Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(),
|
Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(),
|
||||||
Setting.of("Check for new versions at startup", checkForUpdates, "Search for updates every startup"),
|
|
||||||
Setting.of("Start Tab", startTab)),
|
Setting.of("Start Tab", startTab)),
|
||||||
|
|
||||||
Group.of("Player",
|
Group.of("Player",
|
||||||
|
|
|
@ -215,7 +215,6 @@ public class Settings {
|
||||||
public String xlovecamPassword = "";
|
public String xlovecamPassword = "";
|
||||||
public boolean stripchatVR = false;
|
public boolean stripchatVR = false;
|
||||||
public boolean streamrayRecordGoalShows = false;
|
public boolean streamrayRecordGoalShows = false;
|
||||||
public boolean checkForUpdates = true;
|
|
||||||
public int thumbCacheSize = 16;
|
public int thumbCacheSize = 16;
|
||||||
public boolean dreamcamVR = false;
|
public boolean dreamcamVR = false;
|
||||||
public String filterBlacklist = "";
|
public String filterBlacklist = "";
|
||||||
|
|
Loading…
Reference in New Issue