}
long sectionSize = OmFileHelper.getSize(streamsDir);
report.append("Recordings allocates: ").append(OmFileHelper.getHumanSize(sectionSize)).append("\n");
long size = OmFileHelper.getSize(hibernateDir);
long restSize = sectionSize - size;
FlvRecordingDao recordDao = ctx.getBean(FlvRecordingDao.class);
long[] params = {0, 0}; // [0] == deleted [1] == missing
for (FlvRecording rec : recordDao.getAllFlvRecordings()) {
checkRecordingFile(hibernateDir, rec.getFileHash(), rec.getDeleted(), params, cleanup);
checkRecordingFile(hibernateDir, rec.getAlternateDownload(), rec.getDeleted(), params, cleanup);
checkRecordingFile(hibernateDir, rec.getPreviewImage(), rec.getDeleted(), params, cleanup);
}
long invalid = 0;
for (File f : hibernateDir.listFiles()) {
if (f.isFile() && f.getName().endsWith(".flv")) {
FlvRecording rec = recordDao.getRecordingByHash(f.getName());
if (rec == null) {
if (cleanup) {
FileHelper.removeRec(f);
} else {
invalid += f.length();