Added option to not add played to database
Added Search for inspiration Added song for match point
This commit is contained in:
@@ -44,6 +44,7 @@ export default {
|
||||
"hideNextTrack",
|
||||
"roundStarted",
|
||||
"specialTrackIsPlaying",
|
||||
"addPlayed",
|
||||
"lowPlayed",
|
||||
]),
|
||||
},
|
||||
@@ -65,6 +66,9 @@ export default {
|
||||
} else {
|
||||
await this.APIgetRandomizedTrack();
|
||||
}
|
||||
if (this.addPlayed) {
|
||||
await this.APIaddPlayed();
|
||||
}
|
||||
await this.APIaddToQue();
|
||||
trackAddedToQue = true;
|
||||
}
|
||||
@@ -72,8 +76,9 @@ export default {
|
||||
this.currentTrackSrcFile = window.URL.createObjectURL(copyOfPlaylist[0]);
|
||||
/* this.$nextTick(() => {}); */
|
||||
if (!trackAddedToQue) {
|
||||
await this.APIaddToQue();
|
||||
await this.APIaddPlayed();
|
||||
}
|
||||
await this.APIaddToQue();
|
||||
await this.APIgetPlaylistHistory();
|
||||
|
||||
this.$refs.audioPlayer.play();
|
||||
@@ -139,6 +144,15 @@ export default {
|
||||
this.$refs.audioPlayer.play();
|
||||
});
|
||||
},
|
||||
playMatchSound() {
|
||||
this.$refs.audioPlayer.pause();
|
||||
this.currentTrackSrcFile = "sounds/sound0.mp3";
|
||||
this.$store.dispatch("setSpecialTrackIsPlaying", true);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.audioPlayer.currentTime = 0;
|
||||
this.$refs.audioPlayer.play();
|
||||
});
|
||||
},
|
||||
playWinningSound() {
|
||||
this.$refs.audioPlayer.pause();
|
||||
this.currentTrackSrcFile = "sounds/winning.mp3";
|
||||
@@ -208,6 +222,21 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
APIaddPlayed() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.axios({
|
||||
method: "get",
|
||||
url: `${arne.hostname}/music/addPlayed`,
|
||||
})
|
||||
.then(() => {
|
||||
resolve(false);
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log(error);
|
||||
reject();
|
||||
});
|
||||
});
|
||||
},
|
||||
APIaddToQue() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.axios({
|
||||
|
||||
Reference in New Issue
Block a user