File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
MyMusicClientSveltePwa/src/lib/scripts Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -201,15 +201,15 @@ export function setPlaylists(playlistId) {
201201 if ( currentPlaylistId === playlistId ) {
202202 // update current playlist
203203 originalPlaylistSongs = getCachedPlaylistSongs ( playlistId ) ;
204+
205+ // get difference between originalPlaylistSongs and playlistSongs
206+ const newSongs = originalPlaylistSongs . filter ( song => ! playlistSongs . some ( ps => ps . id === song . id ) ) ;
204207
205208 if ( newSongs . length === 0 ) {
206209 // No new songs, nothing to update
207210 return ;
208211 }
209212
210- // get difference between originalPlaylistSongs and playlistSongs
211- const newSongs = originalPlaylistSongs . filter ( song => ! playlistSongs . some ( ps => ps . id === song . id ) ) ;
212-
213213 if ( get ( isShuffledEnabled ) ) {
214214 // shuffle the new songs and add them to the playlist
215215 const shuffledNewSongs = shuffleArray ( newSongs ) ;
You can’t perform that action at this time.
0 commit comments