is anyone reading these commit msgs
This commit is contained in:
parent
4763413520
commit
b5e8e3d481
9 changed files with 66 additions and 10 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue