Explorar o código

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

Kristian Vos %!s(int64=2) %!d(string=hai) anos
pai
achega
9db04fecec
Modificáronse 1 ficheiros con 2 adicións e 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 => {
 							if (
 								songsToAdd.length < songsStillNeeded &&
-								currentYoutubeIds.indexOf(song.youtubeId) === -1
+								currentYoutubeIds.indexOf(song.youtubeId) === -1 &&
+								!songsToAdd.find(songToAdd => songToAdd.youtubeId === song.youtubeId)
 							) {
 								lastSongAdded = song;
 								songsToAdd.push(song);