|
@@ -817,11 +817,26 @@ export default {
|
|
this.updateStationPaused(false);
|
|
this.updateStationPaused(false);
|
|
if (!this.localPaused) this.resumeLocalPlayer();
|
|
if (!this.localPaused) this.resumeLocalPlayer();
|
|
|
|
|
|
- if (this.currentSong)
|
|
|
|
- window.stationNextSongTimeout = setTimeout(
|
|
|
|
- this.skipSong,
|
|
|
|
- this.getTimeRemaining()
|
|
|
|
- );
|
|
|
|
|
|
+ if (this.currentSong) {
|
|
|
|
+ if (this.nextSong)
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: this.nextSong,
|
|
|
|
+ startedAt: Date.now() + this.getTimeRemaining(),
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0
|
|
|
|
+ });
|
|
|
|
+ else
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: null,
|
|
|
|
+ startedAt: 0,
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0,
|
|
|
|
+ pausedAt: 0
|
|
|
|
+ });
|
|
|
|
+ window.stationNextSongTimeout = setTimeout(() => {
|
|
|
|
+ this.skipSong("window.stationNextSongTimeout 2");
|
|
|
|
+ }, this.getTimeRemaining());
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
this.socket.on("event:station.deleted", () => {
|
|
this.socket.on("event:station.deleted", () => {
|
|
@@ -885,6 +900,22 @@ export default {
|
|
|
|
|
|
this.updateNextSong(nextSong);
|
|
this.updateNextSong(nextSong);
|
|
|
|
|
|
|
|
+ if (nextSong)
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: nextSong,
|
|
|
|
+ startedAt: Date.now() + this.getTimeRemaining(),
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0
|
|
|
|
+ });
|
|
|
|
+ else
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: null,
|
|
|
|
+ startedAt: 0,
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0,
|
|
|
|
+ pausedAt: 0
|
|
|
|
+ });
|
|
|
|
+
|
|
this.addPartyPlaylistSongToQueue();
|
|
this.addPartyPlaylistSongToQueue();
|
|
});
|
|
});
|
|
|
|
|
|
@@ -898,6 +929,13 @@ export default {
|
|
: null;
|
|
: null;
|
|
|
|
|
|
this.updateNextSong(nextSong);
|
|
this.updateNextSong(nextSong);
|
|
|
|
+
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: nextSong,
|
|
|
|
+ startedAt: Date.now() + this.getTimeRemaining(),
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
this.socket.on("event:station.voteSkipSong", () => {
|
|
this.socket.on("event:station.voteSkipSong", () => {
|
|
@@ -1041,16 +1079,32 @@ export default {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- setNextCurrentSong(nextCurrentSong) {
|
|
|
|
|
|
+ setNextCurrentSong(nextCurrentSong, skipSkipCheck = false) {
|
|
this.nextCurrentSong = nextCurrentSong;
|
|
this.nextCurrentSong = nextCurrentSong;
|
|
- if (this.getTimeRemaining() <= 0) {
|
|
|
|
|
|
+ if (this.getTimeRemaining() <= 0 && !skipSkipCheck) {
|
|
this.skipSong();
|
|
this.skipSong();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
skipSong() {
|
|
skipSong() {
|
|
- console.log("SKIP_SONG_FN", this.nextCurrentSong);
|
|
|
|
if (this.nextCurrentSong && this.nextCurrentSong.currentSong) {
|
|
if (this.nextCurrentSong && this.nextCurrentSong.currentSong) {
|
|
|
|
+ const songsList = this.songsList.concat([]);
|
|
|
|
+ if (
|
|
|
|
+ songsList.length > 0 &&
|
|
|
|
+ songsList[0].youtubeId ===
|
|
|
|
+ this.nextCurrentSong.currentSong.youtubeId
|
|
|
|
+ ) {
|
|
|
|
+ songsList.splice(0, 1);
|
|
|
|
+ this.updateSongsList(songsList);
|
|
|
|
+ }
|
|
this.setCurrentSong(this.nextCurrentSong);
|
|
this.setCurrentSong(this.nextCurrentSong);
|
|
|
|
+ } else {
|
|
|
|
+ this.setCurrentSong({
|
|
|
|
+ currentSong: null,
|
|
|
|
+ startedAt: 0,
|
|
|
|
+ paused: this.stationPaused,
|
|
|
|
+ timePaused: 0,
|
|
|
|
+ pausedAt: 0
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
setCurrentSong(data) {
|
|
setCurrentSong(data) {
|
|
@@ -1070,13 +1124,16 @@ export default {
|
|
? this.songsList[0]
|
|
? this.songsList[0]
|
|
: null;
|
|
: null;
|
|
this.updateNextSong(nextSong);
|
|
this.updateNextSong(nextSong);
|
|
- this.nextCurrentSong = {
|
|
|
|
- currentSong: null,
|
|
|
|
- startedAt: 0,
|
|
|
|
- paused,
|
|
|
|
- timePaused: 0,
|
|
|
|
- pausedAt: 0
|
|
|
|
- };
|
|
|
|
|
|
+ this.setNextCurrentSong(
|
|
|
|
+ {
|
|
|
|
+ currentSong: null,
|
|
|
|
+ startedAt: 0,
|
|
|
|
+ paused,
|
|
|
|
+ timePaused: 0,
|
|
|
|
+ pausedAt: 0
|
|
|
|
+ },
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
|
|
clearTimeout(window.stationNextSongTimeout);
|
|
clearTimeout(window.stationNextSongTimeout);
|
|
|
|
|
|
@@ -1092,10 +1149,30 @@ export default {
|
|
else this.playVideo();
|
|
else this.playVideo();
|
|
|
|
|
|
if (!this.stationPaused) {
|
|
if (!this.stationPaused) {
|
|
- window.stationNextSongTimeout = setTimeout(
|
|
|
|
- this.skipSong,
|
|
|
|
- this.getTimeRemaining()
|
|
|
|
- );
|
|
|
|
|
|
+ if (this.nextSong)
|
|
|
|
+ this.setNextCurrentSong(
|
|
|
|
+ {
|
|
|
|
+ currentSong: this.nextSong,
|
|
|
|
+ startedAt: Date.now() + this.getTimeRemaining(),
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0
|
|
|
|
+ },
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ else
|
|
|
|
+ this.setNextCurrentSong(
|
|
|
|
+ {
|
|
|
|
+ currentSong: null,
|
|
|
|
+ startedAt: 0,
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0,
|
|
|
|
+ pausedAt: 0
|
|
|
|
+ },
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ window.stationNextSongTimeout = setTimeout(() => {
|
|
|
|
+ this.skipSong("window.stationNextSongTimeout 1");
|
|
|
|
+ }, this.getTimeRemaining());
|
|
}
|
|
}
|
|
|
|
|
|
this.socket.dispatch(
|
|
this.socket.dispatch(
|
|
@@ -1126,6 +1203,8 @@ export default {
|
|
this.updateNoSong(true);
|
|
this.updateNoSong(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ console.log(666);
|
|
|
|
+
|
|
this.calculateTimeElapsed();
|
|
this.calculateTimeElapsed();
|
|
this.resizeSeekerbar();
|
|
this.resizeSeekerbar();
|
|
},
|
|
},
|
|
@@ -1702,6 +1781,13 @@ export default {
|
|
: null;
|
|
: null;
|
|
}
|
|
}
|
|
this.updateNextSong(nextSong);
|
|
this.updateNextSong(nextSong);
|
|
|
|
+ this.setNextCurrentSong({
|
|
|
|
+ currentSong: nextSong,
|
|
|
|
+ startedAt:
|
|
|
|
+ Date.now() + this.getTimeRemaining(),
|
|
|
|
+ paused: false,
|
|
|
|
+ timePaused: 0
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|