Browse Source

Let startedAt reset after new song

theflametrooper 8 years ago
parent
commit
fbbb0edf4c
2 changed files with 3 additions and 3 deletions
  1. 1 1
      backend/logic/stations.js
  2. 2 2
      frontend/components/pages/Station.vue

+ 1 - 1
backend/logic/stations.js

@@ -76,7 +76,7 @@ module.exports = {
 
 				this.timePaused = 0;
 				this.currentSong.startedAt = Date.now();
-				this.nsp.emit("nextSong", this.currentSong);
+				this.nsp.emit("nextSong", this.currentSong, this.currentSong.startedAt);
 			}
 		}
 

+ 2 - 2
frontend/components/pages/Station.vue

@@ -248,9 +248,9 @@
 
 			local.youtubeReady();
 
-			local.stationSocket.on("nextSong", function(currentSong) {
+			local.stationSocket.on("nextSong", function(currentSong, startedAt) {
 				local.currentSong = currentSong;
-				local.startedAt = currentSong.startedAt;
+				local.startedAt = startedAt;
 				local.timePaused = 0;
 				local.playVideo();
 			});