From 5c8aff20edf425bb0e7d17a3b48723d7e65aae34 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Sun, 21 Oct 2018 16:51:53 +0200 Subject: [PATCH] Fix #585: Now start radios immediatly, skipping any existing tracks in queue --- changes/changelog.d/585.enhancement | 1 + front/src/components/radios/Card.vue | 2 +- front/src/store/queue.js | 3 +++ front/src/store/radios.js | 11 ++++++++--- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changes/changelog.d/585.enhancement diff --git a/changes/changelog.d/585.enhancement b/changes/changelog.d/585.enhancement new file mode 100644 index 000000000..51c6aa821 --- /dev/null +++ b/changes/changelog.d/585.enhancement @@ -0,0 +1 @@ +Now start radios immediatly, skipping any existing tracks in queue (#585) diff --git a/front/src/components/radios/Card.vue b/front/src/components/radios/Card.vue index 20300f7ec..ba612f50e 100644 --- a/front/src/components/radios/Card.vue +++ b/front/src/components/radios/Card.vue @@ -14,7 +14,7 @@
- + { logger.default.error('Error while starting radio', type) }) @@ -57,7 +57,7 @@ export default { commit('current', null) commit('running', false) }, - populateQueue ({rootState, state, dispatch}) { + populateQueue ({rootState, state, dispatch}, playNow) { if (!state.running) { return } @@ -69,7 +69,12 @@ export default { } return axios.post('radios/tracks/', params).then((response) => { logger.default.info('Adding track to queue from radio') - dispatch('queue/append', {track: response.data.track}, {root: true}) + let append = dispatch('queue/append', {track: response.data.track}, {root: true}) + if (playNow) { + append.then(() => { + dispatch('queue/last', null, {root: true}) + }) + } }, (response) => { logger.default.error('Error while adding track to queue from radio') })