Ignore empty recording directories in LocalRecorder.getRecordings()

This commit is contained in:
0xboobface 2018-09-08 21:56:18 +02:00
parent 528d7336e1
commit 17901901f9
1 changed files with 5 additions and 0 deletions

View File

@ -448,9 +448,14 @@ public class LocalRecorder implements Recorder {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
if (rec.isDirectory()) {
try {
// ignore directories, which are probably not created by ctbrec
if (rec.getName().length() != pattern.length()) {
continue;
}
// ignore empty directories
if (rec.listFiles().length == 0) {
continue;
}
Date startDate = sdf.parse(rec.getName());
Recording recording = new Recording();