瀏覽代碼

Fixed index error.

KrisVos130 9 年之前
父節點
當前提交
222bb6df66
共有 1 個文件被更改,包括 3 次插入0 次删除
  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}}});