daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Sep 12th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function identifyAlbumsInPlaylist(simplifiedPlaylist, returnSimpleArray=true) {
  2.     //returns an array of albumIds that appear in the playlist, without duplicates
  3.     let albumIds = simplifiedPlaylist.map((track) => {
  4.         if (returnSimpleArray) {
  5.             return track.albumId
  6.         } else {
  7.             return ({albumId: track.albumId, albumName: track.albumName, albumUri: track.albumUri})
  8.         }
  9.     })
  10.     albumIds = uniq(albumIds);
  11.     albumIds = shuffleArray(albumIds);
  12.     return albumIds;
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top