Added option to not add played to database
Added Search for inspiration Added song for match point
This commit is contained in:
1 parent
4e876fa28f
commit
8369b5f0a1
10 files changed
+660
-502
No files matched your search
@@ -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({
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
<template>
|
||||
<div class="theMainDiv">
|
||||
<div class="mainFirstRow">
|
||||
<currently-playing></currently-playing>
|
||||
<inspiration-window></inspiration-window>
|
||||
</div>
|
||||
<div class="mainSecondRow">
|
||||
<playlist-history
|
||||
ref="playlistHistory"
|
||||
@play-selected-track="playSelectedTrack"
|
||||
></playlist-history>
|
||||
<players-window
|
||||
@play-welcome-sound="playWelcomeSound"
|
||||
@play-winning-sound="playWinningSound"
|
||||
></players-window>
|
||||
</div>
|
||||
<extra-buttons
|
||||
v-if="$parent.displayWhenDesktop"
|
||||
@start-sound-test="startSoundTest"
|
||||
></extra-buttons>
|
||||
<the-footer
|
||||
ref="theFooter"
|
||||
@scroll-to-bottom-playlist-history="scrollToBottomPlaylistHistory"
|
||||
></the-footer>
|
||||
<!-- <the-footer ref="theFooter"></the-footer> -->
|
||||
</div>
|
||||
<div class="theMainDiv">
|
||||
<div class="mainFirstRow">
|
||||
<currently-playing></currently-playing>
|
||||
<inspiration-window></inspiration-window>
|
||||
</div>
|
||||
<div class="mainSecondRow">
|
||||
<playlist-history
|
||||
ref="playlistHistory"
|
||||
@play-selected-track="playSelectedTrack"
|
||||
></playlist-history>
|
||||
<players-window
|
||||
@play-welcome-sound="playWelcomeSound"
|
||||
@play-match-point-sound="playMatchSound"
|
||||
@play-winning-sound="playWinningSound"
|
||||
></players-window>
|
||||
</div>
|
||||
<extra-buttons
|
||||
v-if="$parent.displayWhenDesktop"
|
||||
@start-sound-test="startSoundTest"
|
||||
></extra-buttons>
|
||||
<the-footer
|
||||
ref="theFooter"
|
||||
@scroll-to-bottom-playlist-history="scrollToBottomPlaylistHistory"
|
||||
></the-footer>
|
||||
<!-- <the-footer ref="theFooter"></the-footer> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -35,65 +36,68 @@ import extraButtons from "../items/extraButtons.vue";
|
||||
import theFooter from "./TheFooter.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
currentlyPlaying,
|
||||
playersWindow,
|
||||
playlistHistory,
|
||||
inspirationWindow,
|
||||
extraButtons,
|
||||
theFooter,
|
||||
},
|
||||
methods: {
|
||||
playSelectedTrack(track) {
|
||||
this.$refs.theFooter.playSpecificTrack(track);
|
||||
},
|
||||
scrollToBottomPlaylistHistory() {
|
||||
this.$refs.playlistHistory.scrollToBottom();
|
||||
},
|
||||
startSoundTest() {
|
||||
this.$refs.theFooter.startSoundTest();
|
||||
},
|
||||
playWelcomeSound() {
|
||||
this.$refs.theFooter.playWelcomeSound();
|
||||
},
|
||||
playWinningSound() {
|
||||
this.$refs.theFooter.playWinningSound();
|
||||
},
|
||||
},
|
||||
components: {
|
||||
currentlyPlaying,
|
||||
playersWindow,
|
||||
playlistHistory,
|
||||
inspirationWindow,
|
||||
extraButtons,
|
||||
theFooter,
|
||||
},
|
||||
methods: {
|
||||
playSelectedTrack(track) {
|
||||
this.$refs.theFooter.playSpecificTrack(track);
|
||||
},
|
||||
scrollToBottomPlaylistHistory() {
|
||||
this.$refs.playlistHistory.scrollToBottom();
|
||||
},
|
||||
startSoundTest() {
|
||||
this.$refs.theFooter.startSoundTest();
|
||||
},
|
||||
playWelcomeSound() {
|
||||
this.$refs.theFooter.playWelcomeSound();
|
||||
},
|
||||
playMatchSound() {
|
||||
this.$refs.theFooter.playMatchSound();
|
||||
},
|
||||
playWinningSound() {
|
||||
this.$refs.theFooter.playWinningSound();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.theMainDiv {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mainFirstRow {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
margin: 0.5vw;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
margin: 0.5vw;
|
||||
}
|
||||
.mainSecondRow {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
margin: 0 0.5vw;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
margin: 0 0.5vw;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1000px) {
|
||||
.mainFirstRow {
|
||||
margin: 0;
|
||||
margin-top: 0.5vw;
|
||||
}
|
||||
.mainSecondRow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
margin-top: 0.5vw;
|
||||
}
|
||||
.mainFirstRow {
|
||||
margin: 0;
|
||||
margin-top: 0.5vw;
|
||||
}
|
||||
.mainSecondRow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
margin-top: 0.5vw;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user