@@ -200,7 +200,7 @@ let PlaylistExporter = {
200
200
if ( song . track ?. album && song . track . album . id ) { album_ids . add ( song . track . album . id ) }
201
201
// Multiple, comma-separated artists can throw off csv, so surround with "". Same for track and album names,
202
202
// which may contain commas and even quotation marks! Treat with care. Null checking with question marks!
203
- return [ song . track ?. id , '"' + song . track ?. artists ?. map ( artist => { return artist ? artist . id : null } ) . join ( ',' ) + '"' , song . track ?. album ?. id ,
203
+ return [ '"' + song . track ?. artists ?. map ( artist => { return artist ? artist . id : null } ) . join ( ',' ) + '"' , song . track ?. album ?. id , song . track ?. id ,
204
204
'"' + song . track ?. name ?. replace ( / " / g, '' ) + '"' , '"' + song . track ?. album ?. name ?. replace ( / " / g, '' ) + '"' ,
205
205
'"' + song . track ?. artists ?. map ( artist => { return artist ? artist . name : null } ) . join ( ',' ) + '"' ,
206
206
song . track ?. album ?. release_date , song . track ?. duration_ms , song . track ?. popularity , song . added_by ?. id , song . added_at ] ;
@@ -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 [ 0 ] ) . join ( ',' ) ; // the id lives in the first position
244
+ let ids = chunk . map ( song => song [ 2 ] ) . join ( ',' ) ; // the id lives in the third 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 => {
0 commit comments