forked from j62/ctbrec
Add default value for recording priority to settings
This commit is contained in:
parent
dfa70fe9c0
commit
f05353c3e5
|
@ -138,6 +138,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
private SimpleIntegerProperty playlistRequestTimeout;
|
private SimpleIntegerProperty playlistRequestTimeout;
|
||||||
private SimpleBooleanProperty minimizeToTray;
|
private SimpleBooleanProperty minimizeToTray;
|
||||||
private SimpleBooleanProperty showGridLinesInTables;
|
private SimpleBooleanProperty showGridLinesInTables;
|
||||||
|
private SimpleIntegerProperty defaultPriority;
|
||||||
|
|
||||||
public SettingsTab(List<Site> sites, Recorder recorder) {
|
public SettingsTab(List<Site> sites, Recorder recorder) {
|
||||||
this.sites = sites;
|
this.sites = sites;
|
||||||
|
@ -203,6 +204,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
playlistRequestTimeout = new SimpleIntegerProperty(null, "playlistRequestTimeout", settings.playlistRequestTimeout);
|
playlistRequestTimeout = new SimpleIntegerProperty(null, "playlistRequestTimeout", settings.playlistRequestTimeout);
|
||||||
minimizeToTray = new SimpleBooleanProperty(null, "minimizeToTray", settings.minimizeToTray);
|
minimizeToTray = new SimpleBooleanProperty(null, "minimizeToTray", settings.minimizeToTray);
|
||||||
showGridLinesInTables = new SimpleBooleanProperty(null, "showGridLinesInTables", settings.showGridLinesInTables);
|
showGridLinesInTables = new SimpleBooleanProperty(null, "showGridLinesInTables", settings.showGridLinesInTables);
|
||||||
|
defaultPriority = new SimpleIntegerProperty(null, "defaultPriority", settings.defaultPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createGui() {
|
private void createGui() {
|
||||||
|
@ -247,6 +249,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
||||||
.onChange(this::splitValuesChanged),
|
.onChange(this::splitValuesChanged),
|
||||||
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("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"),
|
||||||
|
|
|
@ -33,7 +33,7 @@ public abstract class AbstractModel implements Model {
|
||||||
private String description;
|
private String description;
|
||||||
private List<String> tags = new ArrayList<>();
|
private List<String> tags = new ArrayList<>();
|
||||||
private int streamUrlIndex = -1;
|
private int streamUrlIndex = -1;
|
||||||
private int priority = 50;
|
private int priority = -1;
|
||||||
private boolean suspended = false;
|
private boolean suspended = false;
|
||||||
private boolean markedForLaterRecording = false;
|
private boolean markedForLaterRecording = false;
|
||||||
protected transient Site site;
|
protected transient Site site;
|
||||||
|
@ -222,6 +222,9 @@ public abstract class AbstractModel implements Model {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPriority() {
|
public int getPriority() {
|
||||||
|
if (priority == -1) {
|
||||||
|
priority = Config.getInstance().getSettings().defaultPriority;
|
||||||
|
}
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class Settings {
|
||||||
public int concurrentRecordings = 0;
|
public int concurrentRecordings = 0;
|
||||||
public boolean confirmationForDangerousActions = false;
|
public boolean confirmationForDangerousActions = false;
|
||||||
public String contactsheetTimestampLook = "font=sans-serif:fontcolor=white:fontsize=60:box=1:boxcolor=black@0.5:boxborderw=5";
|
public String contactsheetTimestampLook = "font=sans-serif:fontcolor=white:fontsize=60:box=1:boxcolor=black@0.5:boxborderw=5";
|
||||||
|
public int defaultPriority = 50;
|
||||||
public boolean determineResolution = false;
|
public boolean determineResolution = false;
|
||||||
public List<String> disabledSites = new ArrayList<>();
|
public List<String> disabledSites = new ArrayList<>();
|
||||||
public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
|
public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
|
||||||
|
|
Loading…
Reference in New Issue