Skip to content

Commit

Permalink
Fix next track not working after adding to queue
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed May 7, 2020
1 parent 7e0881f commit 0472988
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ui/src/audioplayer/queue.js
Expand Up @@ -14,6 +14,7 @@ const mapToAudioLists = (item) => ({
singer: item.artist,
cover: subsonic.url('getCoverArt', item.id, { size: 300 }),
musicSrc: subsonic.url('stream', item.id, { ts: true }),
scrobbled: false,
})

const setTrack = (data) => ({
Expand Down Expand Up @@ -84,15 +85,12 @@ const playQueueReducer = (
queue: [mapToAudioLists(data)],
clear: true,
playing: true,
current: data.id,
}
case PLAYER_SYNC_QUEUE:
const currentTrack = data.find((item) => item.id === data.id) || {}
return {
...previousState,
queue: data,
clear: false,
current: currentTrack.id,
}
case PLAYER_SCROBBLE:
const newQueue = previousState.queue.map((item) => {
Expand All @@ -107,7 +105,6 @@ const playQueueReducer = (
queue: newQueue,
clear: false,
playing: true,
current: payload.id,
}
case PLAYER_PLAY_ALBUM:
queue = []
Expand All @@ -125,7 +122,6 @@ const playQueueReducer = (
queue,
clear: true,
playing: true,
current: payload.id,
}
default:
return previousState
Expand Down

0 comments on commit 0472988

Please sign in to comment.