Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
SpotifyWebApi.prototype.getArtistAlbums = function (id, opts) {
var uri = 'https://api.spotify.com/v1/artists/'
uri += encodeURIComponent(id) + '/albums'
opts = opts || {}
opts.limit = opts.limit || 50
uri += '?' + URI.buildQuery(opts)
return this.request(uri).then(function (response) {
if (response &&
response.items) {
return Promise.resolve({body: response})
} else {
return Promise.reject(response)
}
})
}
SpotifyWebApi.prototype.getPlaylistTracks = function (owner, id, opts) {
var uri = 'https://api.spotify.com/v1/users/' +
encodeURIComponent(owner) +
'/playlists/' +
encodeURIComponent(id) +
'/tracks'
opts = opts || {}
opts = URI.buildQuery(opts)
if (opts) {
uri += '?' + opts
}
return this.request(uri).then(function (response) {
if (response &&
response.items) {
return Promise.resolve({body: response})
} else {
return Promise.reject(response)
}
})
}