mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Fix second song on startup not playing
This commit is contained in:
@@ -114,16 +114,14 @@ ipcMain.on('player-set-queue', async (_event, data: PlayerData, pause?: boolean)
|
|||||||
if (data.queue.current) {
|
if (data.queue.current) {
|
||||||
getMpvInstance()
|
getMpvInstance()
|
||||||
?.load(data.queue.current.streamUrl, 'replace')
|
?.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) => {
|
.catch((err) => {
|
||||||
console.log('MPV failed to load song', err);
|
console.log('MPV failed to load song', err);
|
||||||
getMpvInstance()?.play();
|
getMpvInstance()?.play();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (data.queue.next) {
|
||||||
|
getMpvInstance()?.load(data.queue.next.streamUrl, 'append');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user