feat: Add Python video server and improve playback

Co-authored-by: mathieumoran1 <[email protected]>
This commit is contained in:
Cursor Agent
2025-12-22 05:25:19 +00:00
co-authored by mathieumoran1
parent 837e02ef4c
commit e6537884a3
8 changed files with 296 additions and 14 deletions
+3
View File
@@ -648,9 +648,12 @@ router.put("/:id/progress", authenticate, async (req, res) => {
let time = Number(rawTime);
if (!Number.isFinite(time) || time < 0) time = 0;
// Store whole seconds for stable, consistent resume behavior.
time = Math.floor(time);
let duration = rawDuration === undefined || rawDuration === null ? null : Number(rawDuration);
if (duration !== null && (!Number.isFinite(duration) || duration <= 0)) duration = null;
if (duration !== null) duration = Math.floor(duration);
if (duration !== null) {
// Clamp into [0, duration]