add 'add to queue'
This commit is contained in:
parent
b949db6efd
commit
d89bbfe5f7
@ -6,6 +6,9 @@
|
|||||||
<b-dropdown-item-button @click="playNext()">
|
<b-dropdown-item-button @click="playNext()">
|
||||||
Play next
|
Play next
|
||||||
</b-dropdown-item-button>
|
</b-dropdown-item-button>
|
||||||
|
<b-dropdown-item-button @click="addToQueue()">
|
||||||
|
Add to queue
|
||||||
|
</b-dropdown-item-button>
|
||||||
<b-dropdown-item-button @click="toggleStarred()">
|
<b-dropdown-item-button @click="toggleStarred()">
|
||||||
{{ starred ? 'Unstar' : 'Star' }}
|
{{ starred ? 'Unstar' : 'Star' }}
|
||||||
</b-dropdown-item-button>
|
</b-dropdown-item-button>
|
||||||
@ -36,6 +39,9 @@
|
|||||||
playNext() {
|
playNext() {
|
||||||
return this.$store.dispatch("player/playNext", this.track);
|
return this.$store.dispatch("player/playNext", this.track);
|
||||||
},
|
},
|
||||||
|
addToQueue() {
|
||||||
|
return this.$store.dispatch("player/addToQueue", this.track);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -66,6 +66,9 @@ export const playerModule: Module<State, any> = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
addToQueue(state, track) {
|
||||||
|
state.queue.push(track);
|
||||||
|
},
|
||||||
removeFromQueue(state, index) {
|
removeFromQueue(state, index) {
|
||||||
state.queue.splice(index, 1);
|
state.queue.splice(index, 1);
|
||||||
if (index < state.queueIndex) {
|
if (index < state.queueIndex) {
|
||||||
@ -120,6 +123,9 @@ export const playerModule: Module<State, any> = {
|
|||||||
playNext({ commit }, track) {
|
playNext({ commit }, track) {
|
||||||
commit("setNextInQueue", track);
|
commit("setNextInQueue", track);
|
||||||
},
|
},
|
||||||
|
addToQueue({ commit }, track) {
|
||||||
|
commit("addToQueue", track);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user