Explorar el Código

fix: with experimental weights, you could have the same song more than once in the queue

Kristian Vos hace 2 años
padre
commit
9db04fecec
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      backend/logic/stations.js

+ 2 - 1
backend/logic/stations.js

@@ -616,7 +616,8 @@ class _StationsModule extends CoreClass {
 						playlistSongs.every(song => {
 						playlistSongs.every(song => {
 							if (
 							if (
 								songsToAdd.length < songsStillNeeded &&
 								songsToAdd.length < songsStillNeeded &&
-								currentYoutubeIds.indexOf(song.youtubeId) === -1
+								currentYoutubeIds.indexOf(song.youtubeId) === -1 &&
+								!songsToAdd.find(songToAdd => songToAdd.youtubeId === song.youtubeId)
 							) {
 							) {
 								lastSongAdded = song;
 								lastSongAdded = song;
 								songsToAdd.push(song);
 								songsToAdd.push(song);