diff --git a/src/renderer/store/player.store.ts b/src/renderer/store/player.store.ts index 6e2a8286..80c1d240 100644 --- a/src/renderer/store/player.store.ts +++ b/src/renderer/store/player.store.ts @@ -888,8 +888,19 @@ export const usePlayerStore = create()( }, setShuffle: (type: PlayerShuffle) => { if (type === PlayerShuffle.NONE) { + const currentSongId = get().current.song?.uniqueId; + + let currentIndex = 0; + + if (currentSongId) { + currentIndex = get().queue.default.findIndex( + (song) => song.uniqueId === currentSongId, + ); + } + set((state) => { state.shuffle = type; + state.current.index = currentIndex; state.queue.shuffled = []; });