mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 21:10:12 +02:00
fix queue add above current index in priority queue again
This commit is contained in:
@@ -417,6 +417,9 @@ export const usePlayerStoreBase = create<PlayerState>()(
|
||||
|
||||
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<PlayerState>()(
|
||||
}
|
||||
}
|
||||
|
||||
const combinedQueue = [...state.queue.priority, ...state.queue.default];
|
||||
recalculatePlayerIndexByUniqueId(
|
||||
state,
|
||||
currentTrackUniqueId,
|
||||
combinedQueue,
|
||||
);
|
||||
|
||||
if (state.player.shuffle === PlayerShuffle.TRACK) {
|
||||
const currentIndex = state.player.index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user