Fix #632: play button not starting playback with empty queue
This commit is contained in:
parent
e8b2b94df4
commit
4747c6379c
|
@ -0,0 +1 @@
|
||||||
|
Fix play button not starting playback with empty queue (#632)
|
|
@ -70,10 +70,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
appendMany ({state, dispatch}, {tracks, index, callback}) {
|
appendMany ({state, commit, dispatch}, {tracks, index, callback}) {
|
||||||
logger.default.info('Appending many tracks to the queue', tracks.map(e => { return e.title }))
|
logger.default.info('Appending many tracks to the queue', tracks.map(e => { return e.title }))
|
||||||
|
let shouldPlay = false
|
||||||
if (state.tracks.length === 0) {
|
if (state.tracks.length === 0) {
|
||||||
index = 0
|
index = 0
|
||||||
|
shouldPlay = true
|
||||||
} else {
|
} else {
|
||||||
index = index || state.tracks.length
|
index = index || state.tracks.length
|
||||||
}
|
}
|
||||||
|
@ -84,6 +86,11 @@ export default {
|
||||||
if (callback && i + 1 === total) {
|
if (callback && i + 1 === total) {
|
||||||
p.then(callback)
|
p.then(callback)
|
||||||
}
|
}
|
||||||
|
if (shouldPlay && p) {
|
||||||
|
p.then(() => {
|
||||||
|
dispatch('next')
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue