mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 20:49:16 +02:00
Now use vuex to manage state for player/queue/radios
This commit is contained in:
parent
254996453f
commit
df94ae37bf
16 changed files with 563 additions and 694 deletions
|
@ -17,7 +17,6 @@
|
|||
|
||||
<script>
|
||||
import logger from '@/logging'
|
||||
import queue from '@/audio/queue'
|
||||
import jQuery from 'jquery'
|
||||
|
||||
export default {
|
||||
|
@ -40,19 +39,19 @@ export default {
|
|||
methods: {
|
||||
add () {
|
||||
if (this.track) {
|
||||
queue.append(this.track)
|
||||
this.$store.dispatch('queue/append', {track: this.track})
|
||||
} else {
|
||||
queue.appendMany(this.tracks)
|
||||
this.$store.dispatch('queue/appendMany', {tracks: this.tracks})
|
||||
}
|
||||
},
|
||||
addNext (next) {
|
||||
if (this.track) {
|
||||
queue.append(this.track, queue.currentIndex + 1)
|
||||
this.$store.dispatch('queue/append', {track: this.track, index: this.$store.state.queue.currentIndex + 1})
|
||||
} else {
|
||||
queue.appendMany(this.tracks, queue.currentIndex + 1)
|
||||
this.$store.dispatch('queue/appendMany', {tracks: this.tracks, index: this.$store.state.queue.currentIndex + 1})
|
||||
}
|
||||
if (next) {
|
||||
queue.next()
|
||||
this.$store.dispatch('queue/next')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue