diff --git a/changes/changelog.d/632.bugfix b/changes/changelog.d/632.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..1647a04d066c6da32914903a2267e9bffe6e3724 --- /dev/null +++ b/changes/changelog.d/632.bugfix @@ -0,0 +1 @@ +Fix play button not starting playback with empty queue (#632) diff --git a/front/src/components/audio/Player.vue b/front/src/components/audio/Player.vue index 83751d8d44d7d8578dde4352b22341d1d140c4ac..308feb2238e1abd8d64160eb8c031dc572b8ae09 100644 --- a/front/src/components/audio/Player.vue +++ b/front/src/components/audio/Player.vue @@ -80,7 +80,7 @@ class="two wide column control" @click.prevent.stop="previous" :disabled="emptyQueue"> - <i :class="['ui', 'backward', {'disabled': emptyQueue}, 'secondary', 'icon']"></i> + <i :class="['ui', 'backward step', {'disabled': emptyQueue}, 'secondary', 'icon']"></i> </a> <a href @@ -107,7 +107,7 @@ class="two wide column control" @click.prevent.stop="next" :disabled="!hasNext"> - <i :class="['ui', {'disabled': !hasNext}, 'forward', 'secondary', 'icon']" ></i> + <i :class="['ui', {'disabled': !hasNext}, 'forward step', 'secondary', 'icon']" ></i> </a> <div class="wide column control volume-control" diff --git a/front/src/store/queue.js b/front/src/store/queue.js index 2020fd0ba3f20f3e2bf610e28f9d929f7bb5e6d2..717616d2d7a5ada50a943e8c248ca2e8dd394e8f 100644 --- a/front/src/store/queue.js +++ b/front/src/store/queue.js @@ -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 })) + let shouldPlay = false if (state.tracks.length === 0) { index = 0 + shouldPlay = true } else { index = index || state.tracks.length } @@ -84,6 +86,11 @@ export default { if (callback && i + 1 === total) { p.then(callback) } + if (shouldPlay && p) { + p.then(() => { + dispatch('next') + }) + } }) },