room vid automation

This commit is contained in:
Chris Ham
2018-09-26 21:37:45 -07:00
parent b9568c7362
commit fa9c40fb0f
6 changed files with 76 additions and 38 deletions

View File

@@ -18,14 +18,15 @@ populateDatabase();
async function populateDatabase() {
let database = [];
await util.asyncForEach(roomVidFiles, async (file) => {
// @TODO: ignore anything that's not an mp4
await util.asyncForEach(roomVidFiles, async (file, index) => {
// ignore anything that's not an mp4
let shortPath = file.replace(roomVidPath, '');
if (!/\.mp4$/.test(shortPath)) {
return;
}
let entry = {
id: index+1,
shortPath: shortPath,
winPath: shortPath.replace(/\//g, '\\')
};
@@ -39,6 +40,8 @@ async function populateDatabase() {
entry.roomName = matches[4];
}
// @TODO support some other paths / structures
entry.videoData = await getVideoMetadata(file);
database.push(entry);
console.log('added entry', entry);