Browse Source

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

Kristian Vos 1 year ago
parent
commit
ea60b76c2a
1 changed files with 10 additions and 0 deletions
  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 => {