소스 검색

Fixed issue with stations.

KrisVos130 8 년 전
부모
커밋
608f94c70c
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      backend/logic/stations.js

+ 2 - 2
backend/logic/stations.js

@@ -191,8 +191,7 @@ module.exports = {
 								if (station.playlist.length > 0) {
 									function func() {
 										if (station.currentSongIndex < station.playlist.length - 1) {
-											station.currentSongIndex++;
-											songs.getSong(station.playlist[station.currentSongIndex], (err, song) => {
+											songs.getSong(station.playlist[station.currentSongIndex + 1], (err, song) => {
 												if (!err) {
 													let $set = {};
 
@@ -208,6 +207,7 @@ module.exports = {
 													};
 													$set.startedAt = Date.now();
 													$set.timePaused = 0;
+													$set.currentSongIndex = station.currentSongIndex + 1;
 													next(null, $set);
 												} else {
 													db.models.station.update({_id: station._id}, {$inc: {currentSongIndex: 1}}, (err) => {