diff --git a/routes/videoRoutes.js b/routes/videoRoutes.js index 3e58e8d..a7c2f53 100644 --- a/routes/videoRoutes.js +++ b/routes/videoRoutes.js @@ -318,20 +318,19 @@ router.post('/videos/render/:video_id', (req, res) => { const pathList = measureManager.getPathList(measurementIds, project_id).then(pathList => { console.log('Path list:', pathList); res.json({ message: 'Render process started' }); + const videoFile = videoManager.createVideoWithList(project_id, pathList); + console.log('Video file:', videoFile); + + try { + videoManager.updateVideoFile(videoId, videoFile); + } catch (err) { + console.error('Error updating video file:', err); + res.status(500).json({ error: 'Error updating video file' }); + } }).catch(err => { console.error('Error getting path list:', err); res.status(500).json({ error: 'Error getting path list' }); }); - - const videoFile = videoManager.createVideoWithList(project_id, pathList); - console.log('Video file:', videoFile); - - try { - videoManager.updateVideoFile(videoId, videoFile); - } catch (err) { - console.error('Error updating video file:', err); - res.status(500).json({ error: 'Error updating video file' }); - } }); });