Fix next track not working after adding to queue
This commit is contained in:
parent
7e0881f0ec
commit
0472988645
1 changed files with 1 additions and 5 deletions
|
|
@ -14,6 +14,7 @@ const mapToAudioLists = (item) => ({
|
||||||
singer: item.artist,
|
singer: item.artist,
|
||||||
cover: subsonic.url('getCoverArt', item.id, { size: 300 }),
|
cover: subsonic.url('getCoverArt', item.id, { size: 300 }),
|
||||||
musicSrc: subsonic.url('stream', item.id, { ts: true }),
|
musicSrc: subsonic.url('stream', item.id, { ts: true }),
|
||||||
|
scrobbled: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const setTrack = (data) => ({
|
const setTrack = (data) => ({
|
||||||
|
|
@ -84,15 +85,12 @@ const playQueueReducer = (
|
||||||
queue: [mapToAudioLists(data)],
|
queue: [mapToAudioLists(data)],
|
||||||
clear: true,
|
clear: true,
|
||||||
playing: true,
|
playing: true,
|
||||||
current: data.id,
|
|
||||||
}
|
}
|
||||||
case PLAYER_SYNC_QUEUE:
|
case PLAYER_SYNC_QUEUE:
|
||||||
const currentTrack = data.find((item) => item.id === data.id) || {}
|
|
||||||
return {
|
return {
|
||||||
...previousState,
|
...previousState,
|
||||||
queue: data,
|
queue: data,
|
||||||
clear: false,
|
clear: false,
|
||||||
current: currentTrack.id,
|
|
||||||
}
|
}
|
||||||
case PLAYER_SCROBBLE:
|
case PLAYER_SCROBBLE:
|
||||||
const newQueue = previousState.queue.map((item) => {
|
const newQueue = previousState.queue.map((item) => {
|
||||||
|
|
@ -107,7 +105,6 @@ const playQueueReducer = (
|
||||||
queue: newQueue,
|
queue: newQueue,
|
||||||
clear: false,
|
clear: false,
|
||||||
playing: true,
|
playing: true,
|
||||||
current: payload.id,
|
|
||||||
}
|
}
|
||||||
case PLAYER_PLAY_ALBUM:
|
case PLAYER_PLAY_ALBUM:
|
||||||
queue = []
|
queue = []
|
||||||
|
|
@ -125,7 +122,6 @@ const playQueueReducer = (
|
||||||
queue,
|
queue,
|
||||||
clear: true,
|
clear: true,
|
||||||
playing: true,
|
playing: true,
|
||||||
current: payload.id,
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return previousState
|
return previousState
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue