mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
fix mpv autoNext and next song replacement behavior (part 2)
This commit is contained in:
@@ -371,8 +371,14 @@ ipcMain.on('player-set-queue', async (_event, current?: string, next?: string, p
|
||||
// Replaces the queue in position 1 to the given data
|
||||
ipcMain.on('player-set-queue-next', async (_event, url?: string) => {
|
||||
try {
|
||||
const size = await getMpvInstance()?.getPlaylistSize();
|
||||
|
||||
if (size && size > 1) {
|
||||
await getMpvInstance()?.playlistRemove(1);
|
||||
}
|
||||
|
||||
if (url) {
|
||||
await getMpvInstance()?.load(url, 'append');
|
||||
getMpvInstance()?.load(url, 'append');
|
||||
}
|
||||
} catch (err: any | NodeMpvError) {
|
||||
mpvLog({ action: `Failed to set play queue` }, err);
|
||||
|
||||
Reference in New Issue
Block a user