Ver código fonte

Fixed index error.

KrisVos130 9 anos atrás
pai
commit
222bb6df66
1 arquivos alterados com 3 adições e 0 exclusões
  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}}});