Просмотр исходного кода

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

Kristian Vos 1 год назад
Родитель
Сommit
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 => {