spotify-data
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -31,2 +31,3 @@ var spotify = require('./'); | ||
spotify.playlist('minigod', '5ACX9Pa6kRUWWv9ZWD5oH4', console.log); | ||
//spotify.playlist('minigod', '5ACX9Pa6kRUWWv9ZWD5oH4', console.log); | ||
spotify.flatten(['spotify:album:4ARvVncrPdjSZAuvA2AJDP', 'spotify:track:0NQaULcegvCCfiAD8ucCdU'], console.log); |
18
index.js
@@ -209,3 +209,19 @@ var url = require('url'); | ||
} else if (res.info.type === 'album') { | ||
cb(null, res.album.tracks); | ||
// Add album info to every track | ||
var album = res.album.tracks.map(function(track, i) { | ||
track.album = { | ||
href: res.album.href, | ||
released: res.album.released, | ||
name: res.album.name | ||
} | ||
track['track-number'] = i+1; | ||
// Expecting that every track in the album has the same availability. Not sure if this is true. | ||
track.availability = res.album.availability; | ||
return track; | ||
}); | ||
cb(null, album); | ||
} else if (res.info.type === 'playlist') { | ||
@@ -212,0 +228,0 @@ cb(null, res.playlist.tracks); |
{ | ||
"name": "spotify-data", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Simple spotify metadata. Supports playlist, cover art, artist, album and track.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
17496
303