recorder: introduce `settings` in getActiveRecorders()

master
Rob Pilling 2023-11-15 22:42:03 +00:00
parent 22706db541
commit a4716c8718
1 changed files with 3 additions and 3 deletions

View File

@ -161,7 +161,7 @@
return recorders; return recorders;
} }
let getActiveRecorders = function() { let getActiveRecorders = function(settings) {
let activeRecorders = []; let activeRecorders = [];
let recorders = getRecorders(); let recorders = getRecorders();
settings.record.forEach(r => { settings.record.forEach(r => {
@ -206,7 +206,7 @@
if (settings.recording) { if (settings.recording) {
// set up recorders // set up recorders
activeRecorders = getActiveRecorders(); activeRecorders = getActiveRecorders(settings);
activeRecorders.forEach(activeRecorder => { activeRecorders.forEach(activeRecorder => {
activeRecorder.start(); activeRecorder.start();
}); });
@ -255,7 +255,7 @@
} }
var headers = require("Storage").open(settings.file,"r").readLine(); var headers = require("Storage").open(settings.file,"r").readLine();
if (headers){ // if file exists if (headers){ // if file exists
if(headers.trim()!==getCSVHeaders(getActiveRecorders()).join(",")){ if(headers.trim()!==getCSVHeaders(getActiveRecorders(settings)).join(",")){
// headers don't match, reset (#3081) // headers don't match, reset (#3081)
options.force = "new"; options.force = "new";
} }