Add setting to define a default period for "record until"
This commit is contained in:
parent
ea7f56c0fd
commit
923286ae51
|
@ -1,3 +1,7 @@
|
||||||
|
4.6.2
|
||||||
|
========================
|
||||||
|
* Add setting to define a default period for "record until"
|
||||||
|
|
||||||
4.6.1
|
4.6.1
|
||||||
========================
|
========================
|
||||||
* Fixed adding of Streamate models
|
* Fixed adding of Streamate models
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
|
||||||
|
import ctbrec.Config;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -27,14 +28,15 @@ public class RecordUntilDialog {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(RecordUntilDialog.class);
|
private static final Logger LOG = LoggerFactory.getLogger(RecordUntilDialog.class);
|
||||||
|
|
||||||
private Node source;
|
private final Node source;
|
||||||
private Model model;
|
private final Model model;
|
||||||
|
private final GridPane gridPane = new GridPane();
|
||||||
|
|
||||||
private RadioButton pauseButton;
|
private RadioButton pauseButton;
|
||||||
private RadioButton removeButton;
|
private RadioButton removeButton;
|
||||||
private RadioButton recordLaterButton;
|
|
||||||
private DateTimePicker datePicker;
|
private DateTimePicker datePicker;
|
||||||
private GridPane gridPane = new GridPane();
|
|
||||||
|
private Config config = Config.getInstance();
|
||||||
|
|
||||||
public RecordUntilDialog(Node source, Model model) {
|
public RecordUntilDialog(Node source, Model model) {
|
||||||
this.source = source;
|
this.source = source;
|
||||||
|
@ -61,7 +63,7 @@ public class RecordUntilDialog {
|
||||||
removeButton = new RadioButton("remove model");
|
removeButton = new RadioButton("remove model");
|
||||||
removeButton.setSelected(model.getRecordUntilSubsequentAction() == REMOVE);
|
removeButton.setSelected(model.getRecordUntilSubsequentAction() == REMOVE);
|
||||||
removeButton.setToggleGroup(toggleGroup);
|
removeButton.setToggleGroup(toggleGroup);
|
||||||
recordLaterButton = new RadioButton("mark for later");
|
RadioButton recordLaterButton = new RadioButton("mark for later");
|
||||||
recordLaterButton.setSelected(model.getRecordUntilSubsequentAction() == RECORD_LATER);
|
recordLaterButton.setSelected(model.getRecordUntilSubsequentAction() == RECORD_LATER);
|
||||||
recordLaterButton.setToggleGroup(toggleGroup);
|
recordLaterButton.setToggleGroup(toggleGroup);
|
||||||
var row = new VBox();
|
var row = new VBox();
|
||||||
|
@ -73,6 +75,9 @@ public class RecordUntilDialog {
|
||||||
if (model.isRecordingTimeLimited()) {
|
if (model.isRecordingTimeLimited()) {
|
||||||
var localDate = LocalDateTime.ofInstant(model.getRecordUntil(), ZoneId.systemDefault());
|
var localDate = LocalDateTime.ofInstant(model.getRecordUntil(), ZoneId.systemDefault());
|
||||||
datePicker.setDateTimeValue(localDate);
|
datePicker.setDateTimeValue(localDate);
|
||||||
|
} else {
|
||||||
|
var localDate = LocalDateTime.now().plusHours(config.getSettings().recordUntilDefaultPeriodInHours);
|
||||||
|
datePicker.setDateTimeValue(localDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
private SimpleIntegerProperty defaultPriority;
|
private SimpleIntegerProperty defaultPriority;
|
||||||
private LocalTimeProperty timeoutRecordingStartingAt;
|
private LocalTimeProperty timeoutRecordingStartingAt;
|
||||||
private LocalTimeProperty timeoutRecordingEndingAt;
|
private LocalTimeProperty timeoutRecordingEndingAt;
|
||||||
|
private SimpleLongProperty recordUntilDefaultPeriodInHours;
|
||||||
|
|
||||||
public SettingsTab(List<Site> sites, Recorder recorder) {
|
public SettingsTab(List<Site> sites, Recorder recorder) {
|
||||||
this.sites = sites;
|
this.sites = sites;
|
||||||
|
@ -212,6 +213,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
defaultPriority = new SimpleIntegerProperty(null, "defaultPriority", settings.defaultPriority);
|
defaultPriority = new SimpleIntegerProperty(null, "defaultPriority", settings.defaultPriority);
|
||||||
timeoutRecordingStartingAt = new LocalTimeProperty(null, "timeoutRecordingStartingAt", settings.timeoutRecordingStartingAt);
|
timeoutRecordingStartingAt = new LocalTimeProperty(null, "timeoutRecordingStartingAt", settings.timeoutRecordingStartingAt);
|
||||||
timeoutRecordingEndingAt = new LocalTimeProperty(null, "timeoutRecordingEndingAt", settings.timeoutRecordingEndingAt);
|
timeoutRecordingEndingAt = new LocalTimeProperty(null, "timeoutRecordingEndingAt", settings.timeoutRecordingEndingAt);
|
||||||
|
recordUntilDefaultPeriodInHours = new SimpleLongProperty(null, "recordUntilDefaultPeriodInHours", settings.recordUntilDefaultPeriodInHours);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createGui() {
|
private void createGui() {
|
||||||
|
@ -265,6 +267,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
Setting.of("Restrict Resolution", resolutionRange, "Only record streams with resolution within the given range"),
|
Setting.of("Restrict Resolution", resolutionRange, "Only record streams with resolution within the given range"),
|
||||||
Setting.of("Concurrent Recordings (0 = unlimited)", concurrentRecordings),
|
Setting.of("Concurrent Recordings (0 = unlimited)", concurrentRecordings),
|
||||||
Setting.of("Default Priority", defaultPriority),
|
Setting.of("Default Priority", defaultPriority),
|
||||||
|
Setting.of("Default period for \"Record until\" (hours)", recordUntilDefaultPeriodInHours),
|
||||||
Setting.of("Leave space on device (GiB)", leaveSpaceOnDevice,
|
Setting.of("Leave space on device (GiB)", leaveSpaceOnDevice,
|
||||||
"Stop recording, if the free space on the device gets below this threshold").converter(new GigabytesConverter()),
|
"Stop recording, if the free space on the device gets below this threshold").converter(new GigabytesConverter()),
|
||||||
Setting.of("FFmpeg parameters", ffmpegParameters, "FFmpeg parameters to use when merging stream segments"),
|
Setting.of("FFmpeg parameters", ffmpegParameters, "FFmpeg parameters to use when merging stream segments"),
|
||||||
|
|
|
@ -161,6 +161,7 @@ public class Settings {
|
||||||
public DirectoryStructure recordingsDirStructure = DirectoryStructure.FLAT;
|
public DirectoryStructure recordingsDirStructure = DirectoryStructure.FLAT;
|
||||||
public List<Model> recordLater = new ArrayList<>();
|
public List<Model> recordLater = new ArrayList<>();
|
||||||
public boolean recordSingleFile = false;
|
public boolean recordSingleFile = false;
|
||||||
|
public long recordUntilDefaultPeriodInHours = 24L;
|
||||||
public boolean removeRecordingAfterPostProcessing = false;
|
public boolean removeRecordingAfterPostProcessing = false;
|
||||||
public boolean requireAuthentication = false;
|
public boolean requireAuthentication = false;
|
||||||
public String servletContext = "";
|
public String servletContext = "";
|
||||||
|
|
Loading…
Reference in New Issue