diff --git a/src/renderer/store/player.store.ts b/src/renderer/store/player.store.ts index d0b0967ae..1c5784dad 100644 --- a/src/renderer/store/player.store.ts +++ b/src/renderer/store/player.store.ts @@ -417,6 +417,9 @@ export const usePlayerStoreBase = create()( state.queue.default = newQueue; } else { + const currentTrack = state.getCurrentSong() as QueueSong | undefined; + const currentTrackUniqueId = currentTrack?._uniqueId; + const priorityIndex = state.queue.priority.findIndex( (id) => id === uniqueId, ); @@ -451,6 +454,13 @@ export const usePlayerStoreBase = create()( } } + const combinedQueue = [...state.queue.priority, ...state.queue.default]; + recalculatePlayerIndexByUniqueId( + state, + currentTrackUniqueId, + combinedQueue, + ); + if (state.player.shuffle === PlayerShuffle.TRACK) { const currentIndex = state.player.index;