fix shuffle
This commit is contained in:
@@ -146,13 +146,11 @@ class PlayerStore {
|
||||
this.queue.splice(insertIdx, 0, targetTrack);
|
||||
|
||||
if (this.isShuffled) {
|
||||
// Regenerate shuffle indices to be safe as queue shifted
|
||||
this.reshuffle();
|
||||
// Attempt to place new track next in shuffle order?
|
||||
// The reshuffle logic handles "current first", rest random.
|
||||
// Ideally we want playNext to be deterministic even in shuffle.
|
||||
// Getting complex. Let's stick to: "Play Next" inserts after current in Queue.
|
||||
// If Shuffle is on, we force it to be next in shuffledIndices too.
|
||||
// Shift indices that are >= insertIdx because we inserted a new item
|
||||
this.shuffledIndices = this.shuffledIndices.map((i) =>
|
||||
i >= insertIdx ? i + 1 : i,
|
||||
);
|
||||
|
||||
const newIdx = insertIdx;
|
||||
|
||||
// Find where current is in shuffledIndices
|
||||
|
||||
Reference in New Issue
Block a user