kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix #1190: improved shuffle behaviour
rodzic
191f28f79c
commit
cea1c14757
|
@ -0,0 +1 @@
|
|||
Improved shuffle behaviour (#1190)
|
|
@ -158,16 +158,15 @@ export default {
|
|||
// so we replay automatically on next track append
|
||||
commit('ended', true)
|
||||
},
|
||||
shuffle ({dispatch, commit, state}, callback) {
|
||||
let toKeep = state.tracks.slice(0, state.currentIndex + 1)
|
||||
let toShuffle = state.tracks.slice(state.currentIndex + 1)
|
||||
let shuffled = toKeep.concat(_.shuffle(toShuffle))
|
||||
async shuffle ({dispatch, commit, state}, callback) {
|
||||
let shuffled = _.shuffle(state.tracks)
|
||||
commit('tracks', [])
|
||||
let params = {tracks: shuffled}
|
||||
if (callback) {
|
||||
params.callback = callback
|
||||
}
|
||||
dispatch('appendMany', params)
|
||||
await dispatch('appendMany', params)
|
||||
await dispatch('currentIndex', 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue