mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
fix(remote): proper image when mpris and remote interleave
This commit is contained in:
@@ -620,8 +620,11 @@ ipcMain.on('update-playback', (_event, status: PlayerStatus) => {
|
|||||||
broadcast({ data: status, event: 'playback' });
|
broadcast({ data: status, event: 'playback' });
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('update-song', (_event, song: QueueSong | undefined) => {
|
ipcMain.on('update-song', (_event, song: QueueSong | undefined, imageUrl?: null | string) => {
|
||||||
const songChanged = song?.id !== currentState.song?.id;
|
const songChanged = song?.id !== currentState.song?.id;
|
||||||
|
if (song) {
|
||||||
|
song.imageUrl = imageUrl || null;
|
||||||
|
}
|
||||||
currentState.song = song;
|
currentState.song = song;
|
||||||
|
|
||||||
if (songChanged) {
|
if (songChanged) {
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ const updateShuffle = (shuffle: boolean) => {
|
|||||||
ipcRenderer.send('update-shuffle', shuffle);
|
ipcRenderer.send('update-shuffle', shuffle);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateSong = (args: QueueSong | undefined) => {
|
const updateSong = (song: QueueSong | undefined, imageUrl?: null | string) => {
|
||||||
ipcRenderer.send('update-song', args);
|
ipcRenderer.send('update-song', song, imageUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateUsername = (username: string) => {
|
const updateUsername = (username: string) => {
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ export const updateSong = (song: QueueSong | undefined, imageUrl?: null | string
|
|||||||
mediaSession.metadata = metadata;
|
mediaSession.metadata = metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
remote?.updateSong(song);
|
remote?.updateSong(song, imageUrl);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ export const useRemote = () => {
|
|||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
useRemoteUrl: true,
|
useRemoteUrl: true,
|
||||||
}) || null;
|
}) || null;
|
||||||
remote.updateSong({ ...currentSong, imageUrl });
|
|
||||||
|
remote.updateSong(currentSong, imageUrl);
|
||||||
}
|
}
|
||||||
}, [isRemoteEnabled, player]);
|
}, [isRemoteEnabled, player]);
|
||||||
|
|
||||||
@@ -204,7 +205,8 @@ export const useRemote = () => {
|
|||||||
type: 'itemCard',
|
type: 'itemCard',
|
||||||
useRemoteUrl: true,
|
useRemoteUrl: true,
|
||||||
}) || null;
|
}) || null;
|
||||||
remote.updateSong({ ...song, imageUrl });
|
|
||||||
|
remote.updateSong(song, imageUrl);
|
||||||
} else {
|
} else {
|
||||||
remote.updateSong(undefined);
|
remote.updateSong(undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user