is anyone reading these commit msgs

This commit is contained in:
biglyderv 2024-11-25 14:12:43 -05:00
parent dabbc7d862
commit 40f9c219b8
9 changed files with 66 additions and 10 deletions

View file

@ -21,15 +21,17 @@ let main = new Route([auth], async function (req, res, input) {
try {
await execP(`ffmpeg -i ${path} videos/${id}.mp4`);
await execP(`ffmpeg -i videos/${id}.mp4 -frames:v 1 videos/${id}.png`);
} catch (err) {
return { 'success': false, 'message': 'Video is invalid'}
}
await db.run('INSERT INTO video (id, title, desc, username) VALUES (?, ?, ?, ?)', [
await db.run('INSERT INTO video (id, title, desc, username, date) VALUES (?, ?, ?, ?, ?)', [
id,
title,
desc,
username
username,
+new Date()
]);
return { 'message': 'Video created', 'success': true, 'redirect': '/client/video?id='+id };