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

Loading…
Cancel
Save