mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
fix(ui): prevent "Play Next" restarting play at top of queue (#5049)
Set playIndex when rebuilding the queue in reducePlayNext so the music player library knows which track is currently playing. Without this, the library's loadNewAudioLists defaults playIndex to 0, causing playback to restart from the top of the queue on rapid "Play Next" actions. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b64d8ad334
commit
a20d56c137
@ -127,10 +127,12 @@ const reducePlayNext = (state, { data }) => {
|
||||
const newQueue = []
|
||||
const current = state.current || {}
|
||||
let foundPos = false
|
||||
let currentIndex = 0
|
||||
state.queue.forEach((item) => {
|
||||
newQueue.push(item)
|
||||
if (item.uuid === current.uuid) {
|
||||
foundPos = true
|
||||
currentIndex = newQueue.length - 1
|
||||
Object.keys(data).forEach((id) => {
|
||||
newQueue.push(mapToAudioLists(data[id]))
|
||||
})
|
||||
@ -145,6 +147,7 @@ const reducePlayNext = (state, { data }) => {
|
||||
return {
|
||||
...state,
|
||||
queue: newQueue,
|
||||
playIndex: foundPos ? currentIndex : undefined,
|
||||
clear: true,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user