Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function identifyAlbumsInPlaylist(simplifiedPlaylist, returnSimpleArray=true) {
- //returns an array of albumIds that appear in the playlist, without duplicates
- let albumIds = simplifiedPlaylist.map((track) => {
- if (returnSimpleArray) {
- return track.albumId
- } else {
- return ({albumId: track.albumId, albumName: track.albumName, albumUri: track.albumUri})
- }
- })
- albumIds = uniq(albumIds);
- albumIds = shuffleArray(albumIds);
- return albumIds;
- }
Add Comment
Please, Sign In to add comment