From dce30da2e41cbb5b9660069fff8edb808d5b4fec Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Tue, 10 Sep 2024 17:03:55 -0700 Subject: [PATCH] added a couple question marks for null checking, in case a song doesn't have any listed artists --- exportify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exportify.js b/exportify.js index 21857a6..700b974 100755 --- a/exportify.js +++ b/exportify.js @@ -261,8 +261,8 @@ let PlaylistExporter = { data = data.flat() // get rid of the batch dimension (only 100 songs per call) data.forEach(row => { // add genres - let artist_ids = row.shift().slice(1, -1).split(',') // strip the quotes from artist ids, and toss; user doesn't need to see ids - let deduplicated_genres = new Set(artist_ids.map(a => artist_genres[a]).join(",").split(",")) // in case multiple artists + let artist_ids = row.shift()?.slice(1, -1).split(',') // strip the quotes from artist ids, and toss; user doesn't need to see ids + let deduplicated_genres = new Set(artist_ids?.map(a => artist_genres[a]).join(",").split(",")) // in case multiple artists row.push('"'+Array.from(deduplicated_genres).filter(x => x != "").join(",")+'"') // remove empty strings // add album details let album_id = row.shift()