mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +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;
|
state.queue.default = newQueue;
|
||||||
} else {
|
} else {
|
||||||
|
const currentTrack = state.getCurrentSong() as QueueSong | undefined;
|
||||||
|
const currentTrackUniqueId = currentTrack?._uniqueId;
|
||||||
|
|
||||||
const priorityIndex = state.queue.priority.findIndex(
|
const priorityIndex = state.queue.priority.findIndex(
|
||||||
(id) => id === uniqueId,
|
(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) {
|
if (state.player.shuffle === PlayerShuffle.TRACK) {
|
||||||
const currentIndex = state.player.index;
|
const currentIndex = state.player.index;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user