@@ -241,7 +241,7 @@ let PlaylistExporter = {
241
241
let features_promise = Promise . all ( [ data_promise , genre_promise , album_promise ] ) . then ( values => {
242
242
let data = values [ 0 ]
243
243
let songs_promises = data . map ( ( chunk , i ) => { // remember data is an array of arrays, each subarray 100 tracks
244
- let ids = chunk . map ( song => song . shift ( ) ) . join ( ',' ) ; // the id lives in the first position; throw away once grabbed
244
+ let ids = chunk . map ( song => song [ 0 ] ) . join ( ',' ) ; // the id lives in the first position
245
245
return utils . apiCall ( 'https://api.spotify.com/v1/audio-features?ids=' + ids , access_token , 100 * i ) ;
246
246
} )
247
247
return Promise . all ( songs_promises ) . then ( responses => {
@@ -272,7 +272,7 @@ let PlaylistExporter = {
272
272
features = features . flat ( ) // get rid of the batch dimension (only 100 songs per call)
273
273
data . forEach ( ( row , i ) => features [ i ] ?. forEach ( feat => row . push ( feat ) ) )
274
274
// make a string
275
- let csv = "Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,\
275
+ let csv = "Track ID,Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,\
276
276
Danceability,Energy,Key,Loudness,Mode,Speechiness,Acousticness,Instrumentalness,Liveness,Valence,Tempo,Time Signature\n"
277
277
data . forEach ( row => { csv += row . join ( "," ) + "\n" } )
278
278
return csv
0 commit comments