revalidate current song in queue during playback

This commit is contained in:
jeffvli
2026-01-16 04:18:02 -08:00
parent dab1103279
commit fc5024be90
3 changed files with 92 additions and 0 deletions
+14
View File
@@ -2641,6 +2641,20 @@ export const incrementQueuePlayCount = (ids: string[]) => {
});
};
export const updateQueueSong = (songId: string, updatedSong: Song) => {
usePlayerStoreBase.setState((state) => {
Object.values(state.queue.songs).forEach((song) => {
if (song.id === songId) {
const uniqueId = song._uniqueId;
state.queue.songs[song._uniqueId] = {
...updatedSong,
_uniqueId: uniqueId,
};
}
});
});
};
export const usePlayerMuted = () => {
return usePlayerStoreBase((state) => state.player.muted);
};