Refactor video directory handling

main
Filip Borum Poulsen 2 years ago
parent af1e8c780c
commit ecd6cef529

@ -42,6 +42,7 @@ app.get('/videos', (req, res) => {
const list = []; const list = [];
for (const dir of videoDirs) { for (const dir of videoDirs) {
try {
if (!fs.existsSync(dir)) { if (!fs.existsSync(dir)) {
continue; continue;
} }
@ -56,6 +57,10 @@ app.get('/videos', (req, res) => {
list.push(file); list.push(file);
}); });
} }
catch (error) {
console.error(error);
}
}
res.json(list); res.json(list);
}); });

Loading…
Cancel
Save