Merge branch '98-stop-radio-clear' into 'develop'

Resolve "Stop radio when clearing track"

Closes #98

See merge request funkwhale/funkwhale!71
merge-requests/154/head
Eliot Berriot 2018-02-28 17:18:47 +00:00
commit 8635881ad4
5 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -0,0 +1 @@
Fixed queue skipping tracks (#91)

Wyświetl plik

@ -19,7 +19,7 @@
import {mapState} from 'vuex'
import url from '@/utils/url'
import formats from '@/audio/formats'
import _ from 'lodash'
// import logger from '@/logging'
export default {
@ -98,11 +98,11 @@ export default {
}
}
},
updateProgress: function () {
updateProgress: _.throttle(function () {
if (this.$refs.audio) {
this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
}
},
}, 1000),
ended: function () {
if (this.looping === 1) {
this.setCurrentTime(0)

Wyświetl plik

@ -133,8 +133,8 @@ export default {
}
},
clean ({dispatch, commit}) {
dispatch('radios/stop', null, {root: true})
dispatch('player/stop', null, {root: true})
// radios.stop()
commit('tracks', [])
dispatch('currentIndex', -1)
// so we replay automatically on next track append

Wyświetl plik

@ -308,6 +308,7 @@ describe('store/queue', () => {
{ type: 'ended', payload: true }
],
expectedActions: [
{ type: 'radios/stop', payload: null, options: {root: true} },
{ type: 'player/stop', payload: null, options: {root: true} },
{ type: 'currentIndex', payload: -1 }
]