Merge branch '151-queue-delete' into 'develop'
Resolve "Reordering the queue do not honor currently playing track" Closes #151 See merge request funkwhale/funkwhale!158
This commit is contained in:
commit
af883242cb
|
@ -0,0 +1 @@
|
|||
Fixed queue reorder or track deletion restarting currently playing track (#151)
|
|
@ -143,8 +143,9 @@ export default {
|
|||
...mapActions({
|
||||
cleanTrack: 'queue/cleanTrack'
|
||||
}),
|
||||
reorder: function (oldValue, newValue) {
|
||||
this.$store.commit('queue/reorder', {oldValue, newValue})
|
||||
reorder: function (event) {
|
||||
this.$store.commit('queue/reorder', {
|
||||
oldIndex: event.oldIndex, newIndex: event.newIndex})
|
||||
},
|
||||
scrollToCurrent () {
|
||||
let current = $(this.$el).find('[data-tab="queue"] .active')[0]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<audio-track
|
||||
ref="currentAudio"
|
||||
v-if="renderAudio && currentTrack"
|
||||
:key="(currentIndex, currentTrack.id)"
|
||||
:key="currentTrack.id"
|
||||
:is-current="true"
|
||||
:start-time="$store.state.player.currentTime"
|
||||
:autoplay="$store.state.player.playing"
|
||||
|
|
|
@ -86,9 +86,15 @@ export default {
|
|||
}
|
||||
},
|
||||
updateDuration: function (e) {
|
||||
if (!this.$refs.audio) {
|
||||
return
|
||||
}
|
||||
this.$store.commit('player/duration', this.$refs.audio.duration)
|
||||
},
|
||||
loaded: function () {
|
||||
if (!this.$refs.audio) {
|
||||
return
|
||||
}
|
||||
this.$refs.audio.volume = this.volume
|
||||
this.$store.commit('player/resetErrorCount')
|
||||
if (this.isCurrent) {
|
||||
|
|
|
@ -92,10 +92,10 @@ export default {
|
|||
if (current) {
|
||||
dispatch('player/stop', null, {root: true})
|
||||
}
|
||||
if (index < state.currentIndex) {
|
||||
dispatch('currentIndex', state.currentIndex - 1)
|
||||
}
|
||||
commit('splice', {start: index, size: 1})
|
||||
if (index < state.currentIndex) {
|
||||
commit('currentIndex', state.currentIndex - 1)
|
||||
}
|
||||
if (current) {
|
||||
// we play next track, which now have the same index
|
||||
dispatch('currentIndex', index)
|
||||
|
|
|
@ -158,9 +158,7 @@ describe('store/queue', () => {
|
|||
payload: 1,
|
||||
params: {state: {currentIndex: 2}},
|
||||
expectedMutations: [
|
||||
{ type: 'splice', payload: {start: 1, size: 1} }
|
||||
],
|
||||
expectedActions: [
|
||||
{ type: 'splice', payload: {start: 1, size: 1} },
|
||||
{ type: 'currentIndex', payload: 1 }
|
||||
]
|
||||
}, done)
|
||||
|
|
Loading…
Reference in New Issue