소스 검색

fix(Station): Unable to resume station with no current song

Owen Diffey 2 년 전
부모
커밋
552fbab525
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      backend/logic/stations.js

+ 6 - 3
backend/logic/stations.js

@@ -757,11 +757,14 @@ class _StationsModule extends CoreClass {
 					},
 
 					(station, sockets, next) => {
-						const skipVotes = station.currentSong.skipVotes.length;
+						const skipVotes =
+							station.currentSong && station.currentSong.skipVotes
+								? station.currentSong.skipVotes.length
+								: 0;
 						let shouldSkip = false;
 
-						if (sockets.length <= skipVotes) {
-							if (!station.paused) shouldSkip = true;
+						if (skipVotes === 0) {
+							if (!station.paused && !station.currentSong && station.queue.length > 0) shouldSkip = true;
 							return next(null, shouldSkip);
 						}