Réorganiser la logique de rendu vidéo pour gérer les erreurs et améliorer la lisibilité du code

This commit is contained in:
2025-02-12 11:26:57 +01:00
parent e61f1e9773
commit ef09fdb1b4

View File

@@ -318,11 +318,6 @@ 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' });
}).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);
@@ -332,6 +327,10 @@ router.post('/videos/render/:video_id', (req, res) => {
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' });
});
});
});