From 5be4c7dca8e0e393be7ba34f36f3fe64794710c2 Mon Sep 17 00:00:00 2001 From: Brskt Date: Sun, 25 Jan 2026 19:24:51 +0100 Subject: [PATCH] Attempt to fix random playback stops when playing new content The blockAutoPlay mechanism was blocking playback actions even when the user explicitly plays new content. Now only blocks autoplay after manual queue clear (overwritePlayQueue=false), allowing normal playback when selecting new content (overwritePlayQueue=true). --- plugins/lib/src/classes/PlayState.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/lib/src/classes/PlayState.ts b/plugins/lib/src/classes/PlayState.ts index 18dc6d6..c193bd5 100644 --- a/plugins/lib/src/classes/PlayState.ts +++ b/plugins/lib/src/classes/PlayState.ts @@ -183,12 +183,16 @@ export class PlayState { } }); - // Preserve current track when clearing queue + // Preserve current track when clearing queue (manual clear only, not when playing new content) let blockAutoPlay = false; let blockTimeout: ReturnType | undefined; const playActions = ["playbackControls/PLAY", "mix/PLAY_MIX", "playQueue/ADD_NOW", "playQueue/ADD_TRACK_LIST_TO_PLAY_QUEUE"] as const; for (const action of playActions) { - redux.intercept(action, unloads, () => blockAutoPlay); + redux.intercept(action, unloads, (payload: { overwritePlayQueue?: boolean }) => { + // Allow if it's explicit new content (user playing something new) + if (payload?.overwritePlayQueue === true) return false; + return blockAutoPlay; + }); } redux.intercept("playQueue/CLEAR_QUEUE", unloads, () => {