Avoid spoilers in SyncPlay

This commit is contained in:
Ionut Andrei Oanca 2020-12-03 17:14:09 +01:00
parent 3b837b6468
commit 2b97a7912a

View File

@ -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.