From 781582c04351002316b81ef5c63249edae61253a Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 18 Nov 2025 17:13:09 -0800 Subject: [PATCH] fix queue add above current index in priority queue again --- src/renderer/store/player.store.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;