forked from j62/ctbrec
1
0
Fork 0

Fix: recording started event was not fired in client/server mode

This commit is contained in:
0xb00bface 2020-08-21 15:57:50 +02:00
parent 151c58fa9f
commit 3351a976ae
1 changed files with 12 additions and 0 deletions

View File

@ -319,6 +319,18 @@ public class RemoteRecorder implements Recorder {
}
}
}
// fire recording started event
List<Recording> justStarted = new ArrayList<>(newRecordings);
justStarted.removeAll(recordings);
for (Recording recording : justStarted) {
if (recording.getStatus() == Recording.State.RECORDING) {
File file = new File(recording.getPath());
RecordingStateChangedEvent evt = new RecordingStateChangedEvent(file, recording.getStatus(), recording.getModel(),
recording.getStartDate());
EventBusHolder.BUS.post(evt);
}
}
recordings = newRecordings;
} else {
LOG.error(SERVER_RETURNED_ERROR, resp.status, resp.msg);