Filter out songs not in the playlist

This commit is contained in:
Deluan
2020-05-16 19:02:33 -04:00
parent 12cf2f1104
commit c43798c5dd
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -26,7 +26,7 @@ const setTrack = (data) => ({
data,
})
let filterAlbumSongs = function (data, ids) {
let filterSongs = function (data, ids) {
if (!ids) {
return data
}
@@ -34,7 +34,7 @@ let filterAlbumSongs = function (data, ids) {
}
const addTracks = (data, ids) => {
const songs = filterAlbumSongs(data, ids)
const songs = filterSongs(data, ids)
return {
type: PLAYER_ADD_TRACKS,
data: songs,
@@ -53,7 +53,7 @@ const shuffle = (data) => {
}
const shuffleTracks = (data, ids) => {
const songs = filterAlbumSongs(data, ids)
const songs = filterSongs(data, ids)
const shuffled = shuffle(songs)
const firstId = Object.keys(shuffled)[0]
return {
@@ -64,7 +64,7 @@ const shuffleTracks = (data, ids) => {
}
const playTracks = (data, ids, selectedId) => {
const songs = filterAlbumSongs(data, ids)
const songs = filterSongs(data, ids)
return {
type: PLAYER_PLAY_TRACKS,
id: selectedId || Object.keys(songs)[0],