Skip to content
Snippets Groups Projects
Commit 4c2730bc authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '632-play-autostart' into 'develop'

Resolve ""Play Now" button doesn't queue properly"

Closes #632

See merge request funkwhale/funkwhale!498
parents e8b2b94d cbfb2602
No related branches found
No related tags found
No related merge requests found
Fix play button not starting playback with empty queue (#632)
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
class="two wide column control" class="two wide column control"
@click.prevent.stop="previous" @click.prevent.stop="previous"
:disabled="emptyQueue"> :disabled="emptyQueue">
<i :class="['ui', 'backward', {'disabled': emptyQueue}, 'secondary', 'icon']"></i> <i :class="['ui', 'backward step', {'disabled': emptyQueue}, 'secondary', 'icon']"></i>
</a> </a>
<a <a
href href
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
class="two wide column control" class="two wide column control"
@click.prevent.stop="next" @click.prevent.stop="next"
:disabled="!hasNext"> :disabled="!hasNext">
<i :class="['ui', {'disabled': !hasNext}, 'forward', 'secondary', 'icon']" ></i> <i :class="['ui', {'disabled': !hasNext}, 'forward step', 'secondary', 'icon']" ></i>
</a> </a>
<div <div
class="wide column control volume-control" class="wide column control volume-control"
......
...@@ -70,10 +70,12 @@ export default { ...@@ -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 { ...@@ -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')
})
}
}) })
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment