From 5e1059870c228589c5df7aadc2213c62147fdb68 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Thu, 5 Oct 2023 21:54:11 -0700 Subject: [PATCH] Fix second song on startup not playing --- src/main/features/core/player/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/features/core/player/index.ts b/src/main/features/core/player/index.ts index 2f5d5f93..847f518c 100644 --- a/src/main/features/core/player/index.ts +++ b/src/main/features/core/player/index.ts @@ -114,16 +114,14 @@ ipcMain.on('player-set-queue', async (_event, data: PlayerData, pause?: boolean) if (data.queue.current) { getMpvInstance() ?.load(data.queue.current.streamUrl, 'replace') - .then(() => { - // eslint-disable-next-line promise/always-return - if (data.queue.next) { - getMpvInstance()?.load(data.queue.next.streamUrl, 'append'); - } - }) .catch((err) => { console.log('MPV failed to load song', err); getMpvInstance()?.play(); }); + + if (data.queue.next) { + getMpvInstance()?.load(data.queue.next.streamUrl, 'append'); + } } } catch (err) { console.error(err);