implement play next and add to Queue

This commit is contained in:
geoffrey45
2022-05-10 08:24:08 +03:00
parent d49cc65903
commit bee37742c3
5 changed files with 37 additions and 8 deletions
+12
View File
@@ -197,5 +197,17 @@ export default defineStore("Queue", {
this.setNewQueue(tracks);
},
addTrackToQueue(track: Track) {
this.tracks.push(track);
addQToLocalStorage(this.from, this.tracks);
},
playTrackNext(track: Track) {
const current = this.tracks.findIndex(
(t: Track) => t.trackid === this.current.trackid
);
this.tracks.splice(current + 1, 0, track);
addQToLocalStorage(this.from, this.tracks);
},
},
});