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, data,
}) })
let filterAlbumSongs = function (data, ids) { let filterSongs = function (data, ids) {
if (!ids) { if (!ids) {
return data return data
} }
@@ -34,7 +34,7 @@ let filterAlbumSongs = function (data, ids) {
} }
const addTracks = (data, ids) => { const addTracks = (data, ids) => {
const songs = filterAlbumSongs(data, ids) const songs = filterSongs(data, ids)
return { return {
type: PLAYER_ADD_TRACKS, type: PLAYER_ADD_TRACKS,
data: songs, data: songs,
@@ -53,7 +53,7 @@ const shuffle = (data) => {
} }
const shuffleTracks = (data, ids) => { const shuffleTracks = (data, ids) => {
const songs = filterAlbumSongs(data, ids) const songs = filterSongs(data, ids)
const shuffled = shuffle(songs) const shuffled = shuffle(songs)
const firstId = Object.keys(shuffled)[0] const firstId = Object.keys(shuffled)[0]
return { return {
@@ -64,7 +64,7 @@ const shuffleTracks = (data, ids) => {
} }
const playTracks = (data, ids, selectedId) => { const playTracks = (data, ids, selectedId) => {
const songs = filterAlbumSongs(data, ids) const songs = filterSongs(data, ids)
return { return {
type: PLAYER_PLAY_TRACKS, type: PLAYER_PLAY_TRACKS,
id: selectedId || Object.keys(songs)[0], id: selectedId || Object.keys(songs)[0],
+1 -1
View File
@@ -24,7 +24,7 @@ const PlaylistActions = ({
<TopToolbar className={className} {...sanitizeListRestProps(rest)}> <TopToolbar className={className} {...sanitizeListRestProps(rest)}>
<Button <Button
onClick={() => { onClick={() => {
dispatch(playTracks(data)) dispatch(playTracks(data, ids))
}} }}
label={translate('resources.album.actions.playAll')} label={translate('resources.album.actions.playAll')}
> >