slightly better error handling

This commit is contained in:
Kendall Garner 2024-08-27 21:27:49 -07:00
parent 43fe1a235e
commit e68847f50a
No known key found for this signature in database
GPG key ID: 18D2767419676C87

View file

@ -328,11 +328,11 @@ ipcMain.on('player-set-queue', async (_event, data: PlayerData, pause?: boolean)
try {
if (data.queue.current?.streamUrl) {
await getMpvInstance()
?.load(data.queue.current.streamUrl, 'replace')
.catch(() => {
getMpvInstance()?.play();
});
try {
await getMpvInstance()?.load(data.queue.current.streamUrl, 'replace');
} catch (error) {
await getMpvInstance()?.play();
}
if (data.queue.next?.streamUrl) {
await getMpvInstance()?.load(data.queue.next.streamUrl, 'append');