Modifier la fonction createVideoWithList pour inclure l'ID de la vidéo et mettre à jour le statut de la vidéo après le rendu
This commit is contained in:
@@ -27,7 +27,7 @@ async function deleteVideoProject(videoId) {
|
||||
return res.rows[0];
|
||||
}
|
||||
|
||||
async function createVideoWithList(projectId, pathList, duration) {
|
||||
async function createVideoWithList(projectId, pathList, duration, videoId) {
|
||||
const tempFile = path.join('temp.txt');
|
||||
try {
|
||||
const workdir = path.join(PROJECTS_DIR, 'storage', `${projectId}`);
|
||||
@@ -89,6 +89,15 @@ async function createVideoWithList(projectId, pathList, duration) {
|
||||
fs.unlinkSync(tempFile);
|
||||
console.log('Temporary file deleted:', tempFile);
|
||||
}
|
||||
|
||||
//changer status de la vidéo à 1
|
||||
const query = 'UPDATE public.videos SET status = 1 WHERE id = $1';
|
||||
db.query(query, [videoId], (err, results) => {
|
||||
if (err) {
|
||||
return serverError.sendError('Error updating video status:', res, err);
|
||||
}
|
||||
console.log('Video status updated:', results.rows[0]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user