From 7fbe761d7bd8cc49dd28115b2cafe326a41064cb Mon Sep 17 00:00:00 2001 From: Pavel Komarov Date: Tue, 3 Dec 2024 13:56:03 -0800 Subject: [PATCH 1/2] added logic to remove double quotes from artist names --- exportify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exportify.js b/exportify.js index c292b66..cc0ce44 100755 --- a/exportify.js +++ b/exportify.js @@ -202,7 +202,7 @@ let PlaylistExporter = { // which may contain commas and even quotation marks! Treat with care. Null checking with question marks! return ['"'+song.track?.artists?.map(artist => { return artist ? artist.id : null }).join(',')+'"', song.track?.album?.id, song.track?.id, '"'+song.track?.name?.replace(/"/g,'')+'"', '"'+song.track?.album?.name?.replace(/"/g,'')+'"', - '"'+song.track?.artists?.map(artist => { return artist ? artist.name : null}).join(',')+'"', + '"'+song.track?.artists?.map(artist => { return artist ? artist.name?.replace(/"/g,'') : null}).join(',')+'"', song.track?.album?.release_date, song.track?.duration_ms, song.track?.popularity, song.added_by?.id, song.added_at]; }) }) From 165725bb7185a5813927fde366d821f21e3e5728 Mon Sep 17 00:00:00 2001 From: Pavel Komarov Date: Tue, 3 Dec 2024 14:14:39 -0800 Subject: [PATCH 2/2] made title line all one line of code to try to fix offset-by-4 issue --- exportify.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exportify.js b/exportify.js index cc0ce44..9d2ad37 100755 --- a/exportify.js +++ b/exportify.js @@ -272,8 +272,7 @@ let PlaylistExporter = { features = features.flat() // get rid of the batch dimension (only 100 songs per call) data.forEach((row, i) => features[i]?.forEach(feat => row.push(feat))) // make a string - let csv = "Track ID,Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,\ - Danceability,Energy,Key,Loudness,Mode,Speechiness,Acousticness,Instrumentalness,Liveness,Valence,Tempo,Time Signature\n" + let csv = "Track ID,Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,Danceability,Energy,Key,Loudness,Mode,Speechiness,Acousticness,Instrumentalness,Liveness,Valence,Tempo,Time Signature\n" data.forEach(row => { csv += row.join(",") + "\n" }) return csv })