Browse Source

fix: Clear and refill station queue can include the currently playing song in the queue

Owen Diffey 3 years ago
parent
commit
f1c4f5ff1d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      backend/logic/stations.js

+ 3 - 2
backend/logic/stations.js

@@ -479,13 +479,14 @@ class _StationsModule extends CoreClass {
 					},
 
 					(playlist, station, next) => {
+						const songs = playlist.songs.filter(song => song._id !== station.currentSong._id);
 						if (station.playMode === "random") {
-							UtilsModule.runJob("SHUFFLE", { array: playlist.songs }, this)
+							UtilsModule.runJob("SHUFFLE", { array: songs }, this)
 								.then(response => {
 									next(null, response.array, station);
 								})
 								.catch(next);
-						} else next(null, playlist.songs, station);
+						} else next(null, songs, station);
 					},
 
 					(_playlistSongs, station, next) => {