From 3ad6a4ac8faac306ea6cda8fb9059967c7f770b4 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 10 Dec 2025 01:26:32 -0800 Subject: [PATCH] potential fix for mpv clear --- src/main/features/core/player/index.ts | 2 +- .../player/audio-player/engine/mpv-player-engine.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/features/core/player/index.ts b/src/main/features/core/player/index.ts index 1bdb07dd..9080037b 100644 --- a/src/main/features/core/player/index.ts +++ b/src/main/features/core/player/index.ts @@ -114,7 +114,7 @@ const createMpv = async (data: { mpv.on('status', (status) => { if (status.property === 'playlist-pos') { if (status.value === -1) { - mpv?.stop(); + mpv?.pause(); } if (status.value !== 0) { diff --git a/src/renderer/features/player/audio-player/engine/mpv-player-engine.tsx b/src/renderer/features/player/audio-player/engine/mpv-player-engine.tsx index 10b2282c..fae079af 100644 --- a/src/renderer/features/player/audio-player/engine/mpv-player-engine.tsx +++ b/src/renderer/features/player/audio-player/engine/mpv-player-engine.tsx @@ -156,9 +156,11 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => { mpvPlayer.setQueue(currentSrc, nextSrc, playerStatus !== PlayerStatus.PLAYING); setPreviousCurrentSrc(currentSrc); } else { - // Clear queue if no current song - mpvPlayer.setQueue(undefined, undefined, true); - setPreviousCurrentSrc(undefined); + // Only clear queue if we had a previous currentSrc (intentional clear) + if (previousCurrentSrc !== undefined) { + mpvPlayer.setQueue(undefined, undefined, true); + setPreviousCurrentSrc(undefined); + } } } else { // If currentSrc hasn't changed but nextSrc has, update position 1