cody-music
Advanced tools
Comparing version 2.7.7 to 2.7.8
@@ -148,3 +148,3 @@ "use strict"; | ||
}); | ||
const tracks = []; | ||
const tracksToReturn = []; | ||
const api = `/v1/tracks`; | ||
@@ -173,4 +173,10 @@ const qsOptions = { ids: finalIds.join(",") }; | ||
const artist = track.artists[i]; | ||
const artistData = await this.getSpotifyArtistById(artist.id); | ||
artists.push(artistData); | ||
try { | ||
const artistData = await this.getSpotifyArtistById(artist.id); | ||
artists.push(artistData); | ||
} | ||
catch (e) { | ||
// just use the current artists info | ||
artists.push(artist); | ||
} | ||
} | ||
@@ -202,3 +208,3 @@ if (artists.length > 0) { | ||
} | ||
tracks.push(track); | ||
tracksToReturn.push(track); | ||
} | ||
@@ -222,3 +228,3 @@ // get the features | ||
} | ||
return tracks; | ||
return tracksToReturn; | ||
} | ||
@@ -225,0 +231,0 @@ async getSpotifyTrackById(id, includeArtistData = false, includeAudioFeaturesData = false, includeGenre = false) { |
@@ -175,3 +175,3 @@ import { MusicUtil } from "./util"; | ||
}); | ||
const tracks: Track[] = []; | ||
const tracksToReturn: Track[] = []; | ||
const api = `/v1/tracks`; | ||
@@ -207,6 +207,11 @@ const qsOptions = { ids: finalIds.join(",") }; | ||
const artist = track.artists[i]; | ||
const artistData: Artist = await this.getSpotifyArtistById( | ||
artist.id | ||
); | ||
artists.push(artistData); | ||
try { | ||
const artistData: Artist = await this.getSpotifyArtistById( | ||
artist.id | ||
); | ||
artists.push(artistData); | ||
} catch (e) { | ||
// just use the current artists info | ||
artists.push(artist); | ||
} | ||
} | ||
@@ -247,3 +252,3 @@ if (artists.length > 0) { | ||
tracks.push(track); | ||
tracksToReturn.push(track); | ||
} | ||
@@ -273,3 +278,3 @@ | ||
return tracks; | ||
return tracksToReturn; | ||
} | ||
@@ -276,0 +281,0 @@ |
{ | ||
"name": "cody-music", | ||
"version": "2.7.7", | ||
"version": "2.7.8", | ||
"description": "mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
546149
13275