Explorar o código

Fixed index error.

KrisVos130 %!s(int64=9) %!d(string=hai) anos
pai
achega
222bb6df66
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app/server/server.js

+ 3 - 0
app/server/server.js

@@ -72,6 +72,9 @@ function Station(type) {
         songs = playlist.songs;
     }
     var currentSong = playlist.lastSong;
+    if (currentSong < (songs.length - 1)) {
+        currentSong++;
+    } else currentSong = 0;
     var currentTitle = songs[currentSong].title;
 
     Rooms.update({type: type}, {$set: {currentSong: {song: songs[currentSong], started: startedAt}}});