Automatically delete empty recordings
This commit is contained in:
parent
501f685626
commit
c0167155f3
|
@ -117,8 +117,7 @@ public class NextGenLocalRecorder implements Recorder {
|
|||
Model model = recording.getModel();
|
||||
tryRestartRecording(model);
|
||||
} else {
|
||||
// TODO is this ok?
|
||||
setRecordingStatus(recording, State.FAILED);
|
||||
if(recording.getStatus() != State.DELETED) {
|
||||
recordingsLock.lock();
|
||||
try {
|
||||
recordingManager.delete(recording);
|
||||
|
@ -128,6 +127,8 @@ public class NextGenLocalRecorder implements Recorder {
|
|||
recordingsLock.unlock();
|
||||
}
|
||||
}
|
||||
setRecordingStatus(recording, State.FAILED);
|
||||
}
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -255,12 +256,8 @@ public class NextGenLocalRecorder implements Recorder {
|
|||
|
||||
private boolean deleteIfTooShort(Recording rec) throws IOException, ParseException, PlaylistException {
|
||||
Duration minimumLengthInSeconds = Duration.ofSeconds(Config.getInstance().getSettings().minimumLengthInSeconds);
|
||||
if (minimumLengthInSeconds.getSeconds() <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Duration recordingLength = rec.getLength();
|
||||
if (recordingLength.compareTo(minimumLengthInSeconds) < 0) {
|
||||
if (recordingLength.compareTo(minimumLengthInSeconds) < 0 || recordingLength.isZero()) {
|
||||
recordingManager.delete(rec);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue