Преглед на файлове

Let startedAt reset after new song

theflametrooper преди 8 години
родител
ревизия
fbbb0edf4c
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  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();
 			});