From dec6be54764b6ed48d1061e62db10c24265d70b6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Mar 2026 23:55:57 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20Seek=20funktioniert=20jetzt=20f=C3=BCr?= =?UTF-8?q?=20alle=20User=20=E2=80=94=20report=5Ftime=20=C3=BCberschreibt?= =?UTF-8?q?=20Seek=20nicht=20mehr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Server: report_time ignoriert Host-Updates für 2s nach einem Seek - Frontend: seekingRef Guard auf 3s erhöht um Sync-Pulse-Rücksetzung zu verhindern Co-Authored-By: Claude Opus 4.6 --- server/src/plugins/watch-together/index.ts | 5 +++++ web/src/plugins/watch-together/WatchTogetherTab.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/plugins/watch-together/index.ts b/server/src/plugins/watch-together/index.ts index 66363ea..9601dc8 100644 --- a/server/src/plugins/watch-together/index.ts +++ b/server/src/plugins/watch-together/index.ts @@ -459,7 +459,12 @@ async function handleMessage(client: WtClient, msg: any): Promise { if (!client.roomId) return; const room = rooms.get(client.roomId); if (!room) return; + // Only accept time reports from the host to avoid conflicts + // when multiple users report different times if (room.hostId !== client.id) return; + // Ignore if a seek happened recently (within 2s) to prevent overwriting + const timeSinceSync = Date.now() - room.lastSyncAt; + if (timeSinceSync < 2000) return; room.currentTime = Number(msg.time) || 0; room.lastSyncAt = Date.now(); break; diff --git a/web/src/plugins/watch-together/WatchTogetherTab.tsx b/web/src/plugins/watch-together/WatchTogetherTab.tsx index 317a53f..1655031 100644 --- a/web/src/plugins/watch-together/WatchTogetherTab.tsx +++ b/web/src/plugins/watch-together/WatchTogetherTab.tsx @@ -690,7 +690,7 @@ export default function WatchTogetherTab({ data }: { data: any }) { dmPlayerRef.current.contentWindow.postMessage(`seek?to=${time}`, 'https://www.dailymotion.com'); } setCurrentTime(time); - setTimeout(() => { seekingRef.current = false; }, 1000); + setTimeout(() => { seekingRef.current = false; }, 3000); }, [wsSend]); // ── Host time reporting ──