kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix #585: Now start radios immediatly, skipping any existing tracks in queue
rodzic
7a5a7208bf
commit
5c8aff20ed
|
@ -0,0 +1 @@
|
|||
Now start radios immediatly, skipping any existing tracks in queue (#585)
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="extra content">
|
||||
<user-link :user="radio.user" class="left floated" />
|
||||
<user-link v-if="radio.user" :user="radio.user" class="left floated" />
|
||||
<radio-button class="right floated button" :type="type" :custom-radio-id="customRadioId"></radio-button>
|
||||
<router-link
|
||||
class="ui basic yellow button right floated"
|
||||
|
|
|
@ -135,6 +135,9 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
last ({state, dispatch}) {
|
||||
dispatch('currentIndex', state.tracks.length - 1)
|
||||
},
|
||||
currentIndex ({commit, state, rootState, dispatch}, index) {
|
||||
commit('ended', false)
|
||||
commit('player/currentTime', 0, {root: true})
|
||||
|
|
|
@ -48,7 +48,7 @@ export default {
|
|||
logger.default.info('Successfully started radio ', type)
|
||||
commit('current', {type, objectId, session: response.data.id, customRadioId})
|
||||
commit('running', true)
|
||||
dispatch('populateQueue')
|
||||
dispatch('populateQueue', true)
|
||||
}, (response) => {
|
||||
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')
|
||||
})
|
||||
|
|
Ładowanie…
Reference in New Issue