Skip to content

Commit

Permalink
added a couple question marks for null checking, in case a song doesn…
Browse files Browse the repository at this point in the history
…'t have any listed artists
  • Loading branch information
pavelkomarov committed Sep 11, 2024
1 parent f0dc213 commit dce30da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exportify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dce30da

Please sign in to comment.