Added setting to delete orphaned recording metadata (switched off by default)
This commit is contained in:
parent
3caefd6bb4
commit
932974137c
|
@ -131,6 +131,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
private PostProcessingStepPanel postProcessingStepPanel;
|
||||
private SimpleStringProperty filterBlacklist;
|
||||
private SimpleStringProperty filterWhitelist;
|
||||
private SimpleBooleanProperty deleteOrphanedRecordingMetadata;
|
||||
|
||||
public SettingsTab(List<Site> sites, Recorder recorder) {
|
||||
this.sites = sites;
|
||||
|
@ -211,6 +212,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
checkForUpdates = new SimpleBooleanProperty(null, "checkForUpdates", settings.checkForUpdates);
|
||||
filterBlacklist = new SimpleStringProperty(null, "filterBlacklist", settings.filterBlacklist);
|
||||
filterWhitelist = new SimpleStringProperty(null, "filterWhitelist", settings.filterWhitelist);
|
||||
deleteOrphanedRecordingMetadata = new SimpleBooleanProperty(null, "deleteOrphanedRecordingMetadata", settings.deleteOrphanedRecordingMetadata);
|
||||
}
|
||||
|
||||
private void createGui() {
|
||||
|
@ -281,7 +283,8 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
Setting.of("FFmpeg parameters", ffmpegParameters, "FFmpeg parameters to use when merging stream segments"),
|
||||
Setting.of("File Extension", fileExtension, "File extension to use for recordings"),
|
||||
Setting.of("Check online state every (seconds)", onlineCheckIntervalInSecs, "Check every x seconds, if a model came online"),
|
||||
Setting.of("Skip online check for paused models", onlineCheckSkipsPausedModels, "Skip online check for paused models")),
|
||||
Setting.of("Skip online check for paused models", onlineCheckSkipsPausedModels, "Skip online check for paused models"),
|
||||
Setting.of("Delete orphaned recording metadata", deleteOrphanedRecordingMetadata, "Delete recordings for which the video files are missing on start")),
|
||||
Group.of("Timeout",
|
||||
Setting.of("Don't record from", timeoutRecordingStartingAt),
|
||||
Setting.of("Until", timeoutRecordingEndingAt)
|
||||
|
@ -301,13 +304,13 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
Setting.of("Steps", postProcessingStepPanel),
|
||||
Setting.of("", createHelpButton("Post-Processing Help", "http://localhost:5689/docs/PostProcessing.md")),
|
||||
Setting.of("", createVariablePlayGroundButton()))),
|
||||
Category.of("Events & Actions", new ActionSettingsPanel(recorder)),
|
||||
Category.of("Events & Actions", new ActionSettingsPanel(recorder)),
|
||||
Category.of("Filtering",
|
||||
Group.of("Ignore List",
|
||||
Setting.of("", ignoreList)),
|
||||
Group.of("Text Filters",
|
||||
Setting.of("Blacklist", filterBlacklist, "Default list of blacklist filters for site views, space seperated"),
|
||||
Setting.of("Whitelist", filterWhitelist, "Default list of whitelist filters for site views, space seperated"))), Category.of("Sites", siteCategories.toArray(new Category[0])),
|
||||
Group.of("Ignore List",
|
||||
Setting.of("", ignoreList)),
|
||||
Group.of("Text Filters",
|
||||
Setting.of("Blacklist", filterBlacklist, "Default list of blacklist filters for site views, space seperated"),
|
||||
Setting.of("Whitelist", filterWhitelist, "Default list of whitelist filters for site views, space seperated"))), Category.of("Sites", siteCategories.toArray(new Category[0])),
|
||||
Category.of("Proxy",
|
||||
Group.of("Proxy",
|
||||
Setting.of("Type", proxyType).needsRestart(),
|
||||
|
|
|
@ -66,6 +66,7 @@ public class Settings {
|
|||
public String contactsheetTimestampLook = "font=sans-serif:fontcolor=white:fontsize=60:box=1:boxcolor=black@0.5:boxborderw=5";
|
||||
public String dateTimeFormat = "";
|
||||
public int defaultPriority = 50;
|
||||
public boolean deleteOrphanedRecordingMetadata = false;
|
||||
public boolean determineResolution = false;
|
||||
public List<String> disabledSites = new ArrayList<>();
|
||||
public String downloadFilename = "$sanitize(${modelName})_$format(${localDateTime})";
|
||||
|
|
|
@ -104,7 +104,13 @@ public class RecordingManager {
|
|||
if (recordingExists(recording)) {
|
||||
recordings.add(recording);
|
||||
} else {
|
||||
log.info("Recording {} does not exist anymore -> ignoring recording", recording);
|
||||
if (config.getSettings().deleteOrphanedRecordingMetadata) {
|
||||
log.info("Recording {} does not exist anymore -> deleting recording", recording);
|
||||
boolean deleted = Files.deleteIfExists(new File(recording.getMetaDataFile()).toPath());
|
||||
log.info("Recording {} has {}been deleted", recording, deleted ? "" : "not ");
|
||||
} else {
|
||||
log.info("Recording {} does not exist anymore -> ignoring recording", recording);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue