浏览代码

refactor: don't autorequest songs that are already playing or in the queue

Kristian Vos 1 年之前
父节点
当前提交
ea60b76c2a
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      frontend/src/pages/Station/index.vue

+ 10 - 0
frontend/src/pages/Station/index.vue

@@ -256,6 +256,16 @@ const autoRequestSong = () => {
 		);
 	}
 
+	if (songsList.value) {
+		songsList.value.forEach(song => {
+			excludedYoutubeIds.push(song.youtubeId);
+		});
+	}
+
+	if (!noSong.value) {
+		excludedYoutubeIds.push(currentSong.value.youtubeId);
+	}
+
 	const uniqueYoutubeIds = new Set();
 
 	autoRequest.value.forEach(playlist => {