From 2b97a7912a9a1cb293b5cfa5c544d71cb6eab351 Mon Sep 17 00:00:00 2001 From: Ionut Andrei Oanca Date: Thu, 3 Dec 2020 17:14:09 +0100 Subject: [PATCH] Avoid spoilers in SyncPlay --- src/components/syncPlay/core/PlaybackCore.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/syncPlay/core/PlaybackCore.js b/src/components/syncPlay/core/PlaybackCore.js index 6916aebbe3..203af7ebcd 100644 --- a/src/components/syncPlay/core/PlaybackCore.js +++ b/src/components/syncPlay/core/PlaybackCore.js @@ -503,6 +503,12 @@ class PlaybackCore { if (!lastCommand || lastCommand.Command !== 'Unpause' || this.isBuffering()) return; + // Avoid spoilers by making sure that command item matches current playlist item. + // This check is needed when switching from one item to another. + const queueCore = this.manager.getQueueCore(); + const currentPlaylistItem = queueCore.getCurrentPlaylistItemId(); + if (lastCommand.PlaylistItemId !== currentPlaylistItem) return; + const { currentTime, currentPosition } = timeUpdateData; // Get current PositionTicks.