浏览代码

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) => {