Merge branch '98-stop-radio-clear' into 'develop'
Resolve "Stop radio when clearing track" Closes #98 See merge request funkwhale/funkwhale!71
This commit is contained in:
		
						commit
						8635881ad4
					
				| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Fixed queue skipping tracks (#91)
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
import {mapState} from 'vuex'
 | 
					import {mapState} from 'vuex'
 | 
				
			||||||
import url from '@/utils/url'
 | 
					import url from '@/utils/url'
 | 
				
			||||||
import formats from '@/audio/formats'
 | 
					import formats from '@/audio/formats'
 | 
				
			||||||
 | 
					import _ from 'lodash'
 | 
				
			||||||
// import logger from '@/logging'
 | 
					// import logger from '@/logging'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
| 
						 | 
					@ -98,11 +98,11 @@ export default {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    updateProgress: function () {
 | 
					    updateProgress: _.throttle(function () {
 | 
				
			||||||
      if (this.$refs.audio) {
 | 
					      if (this.$refs.audio) {
 | 
				
			||||||
        this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
 | 
					        this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    }, 1000),
 | 
				
			||||||
    ended: function () {
 | 
					    ended: function () {
 | 
				
			||||||
      if (this.looping === 1) {
 | 
					      if (this.looping === 1) {
 | 
				
			||||||
        this.setCurrentTime(0)
 | 
					        this.setCurrentTime(0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,8 +133,8 @@ export default {
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    clean ({dispatch, commit}) {
 | 
					    clean ({dispatch, commit}) {
 | 
				
			||||||
 | 
					      dispatch('radios/stop', null, {root: true})
 | 
				
			||||||
      dispatch('player/stop', null, {root: true})
 | 
					      dispatch('player/stop', null, {root: true})
 | 
				
			||||||
      // radios.stop()
 | 
					 | 
				
			||||||
      commit('tracks', [])
 | 
					      commit('tracks', [])
 | 
				
			||||||
      dispatch('currentIndex', -1)
 | 
					      dispatch('currentIndex', -1)
 | 
				
			||||||
      // so we replay automatically on next track append
 | 
					      // so we replay automatically on next track append
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -308,6 +308,7 @@ describe('store/queue', () => {
 | 
				
			||||||
          { type: 'ended', payload: true }
 | 
					          { type: 'ended', payload: true }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        expectedActions: [
 | 
					        expectedActions: [
 | 
				
			||||||
 | 
					          { type: 'radios/stop', payload: null, options: {root: true} },
 | 
				
			||||||
          { type: 'player/stop', payload: null, options: {root: true} },
 | 
					          { type: 'player/stop', payload: null, options: {root: true} },
 | 
				
			||||||
          { type: 'currentIndex', payload: -1 }
 | 
					          { type: 'currentIndex', payload: -1 }
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue