attempt to fix mpv autoNext behavior (#1768)

This commit is contained in:
jeffvli
2026-02-27 00:28:03 -08:00
parent b62f62671d
commit afca396654
2 changed files with 66 additions and 15 deletions
+5 -1
View File
@@ -116,11 +116,15 @@ const createMpv = async (data: {
mpv.on('status', (status) => {
if (status.property === 'playlist-pos') {
// mpv uses playlist-pos = -1 when nothing is playing (ended, cleared, load failure, etc).
if (status.value === -1) {
mpv?.pause();
return;
}
if (status.value !== 0) {
// In our 2-item queue model, playlist-pos should normally be 0.
// When mpv auto-advances to the next track it becomes > 0 (typically 1).
if (typeof status.value === 'number' && status.value > 0) {
getMainWindow()?.webContents.send('renderer-player-auto-next');
}
}