Skip to content

Commit

Permalink
Add recently played tracks - Fixes JMPerez#57 (JMPerez#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPerez authored Apr 2, 2017
1 parent c674653 commit 234ea0f
Show file tree
Hide file tree
Showing 10 changed files with 1,333 additions and 1,067 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
rules:
brace-style: [2, "1tbs"]
comma-style: [2, "last"]
camelcase: 2
camelcase: 0
curly: 2
default-case: 2
eqeqeq: 2
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The wrapper includes helper functions to do the following:

#### Personalization
- Get a user’s top artists and tracks based on calculated affinity
- Get current user’s recently played tracks

#### Browse
- Get new releases
Expand Down
3 changes: 2 additions & 1 deletion __test__/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ module.exports = {
follow_are_following_playlist: loadFixture('follow_are_following_playlist'),
followed_artists: loadFixture('followed_artists'),
recommendations: loadFixture('recommendations'),
genre_seeds: loadFixture('genre_seeds')
genre_seeds: loadFixture('genre_seeds'),
recently_played_tracks: loadFixture('recently_played_tracks')
};
97 changes: 97 additions & 0 deletions __test__/fixtures/recently_played_tracks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"items": [
{
"track": {
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/5INjqkS1o8h1imAzPqGZBb"
},
"href": "https://api.spotify.com/v1/artists/5INjqkS1o8h1imAzPqGZBb",
"id": "5INjqkS1o8h1imAzPqGZBb",
"name": "Tame Impala",
"type": "artist",
"uri": "spotify:artist:5INjqkS1o8h1imAzPqGZBb"
}
],
"available_markets": [
"CA",
"MX",
"US"
],
"disc_number": 1,
"duration_ms": 108546,
"explicit": false,
"external_urls": {
"spotify": "https://open.spotify.com/track/2gNfxysfBRfl9Lvi9T3v6R"
},
"href": "https://api.spotify.com/v1/tracks/2gNfxysfBRfl9Lvi9T3v6R",
"id": "2gNfxysfBRfl9Lvi9T3v6R",
"name": "Disciples",
"preview_url": "https://p.scdn.co/mp3-preview/6023e5aac2123d098ce490488966b28838b14fa2",
"track_number": 9,
"type": "track",
"uri": "spotify:track:2gNfxysfBRfl9Lvi9T3v6R"
},
"played_at": "2016-12-13T20:44:04.589Z",
"context": {
"uri": "spotify:artist:5INjqkS1o8h1imAzPqGZBb",
"external_urls": {
"spotify": "https://open.spotify.com/artist/5INjqkS1o8h1imAzPqGZBb"
},
"href": "https://api.spotify.com/v1/artists/5INjqkS1o8h1imAzPqGZBb",
"type": "artist"
}
},
{
"track": {
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/5INjqkS1o8h1imAzPqGZBb"
},
"href": "https://api.spotify.com/v1/artists/5INjqkS1o8h1imAzPqGZBb",
"id": "5INjqkS1o8h1imAzPqGZBb",
"name": "Tame Impala",
"type": "artist",
"uri": "spotify:artist:5INjqkS1o8h1imAzPqGZBb"
}
],
"available_markets": [
"CA",
"MX",
"US"
],
"disc_number": 1,
"duration_ms": 467586,
"explicit": false,
"external_urls": {
"spotify": "https://open.spotify.com/track/2X485T9Z5Ly0xyaghN73ed"
},
"href": "https://api.spotify.com/v1/tracks/2X485T9Z5Ly0xyaghN73ed",
"id": "2X485T9Z5Ly0xyaghN73ed",
"name": "Let It Happen",
"preview_url": "https://p.scdn.co/mp3-preview/05dee1ad0d2a6fa4ad07fbd24ae49d58468e8194",
"track_number": 1,
"type": "track",
"uri": "spotify:track:2X485T9Z5Ly0xyaghN73ed"
},
"played_at": "2016-12-13T20:42:17.016Z",
"context": {
"uri": "spotify:artist:5INjqkS1o8h1imAzPqGZBb",
"external_urls": {
"spotify": "https://open.spotify.com/artist/5INjqkS1o8h1imAzPqGZBb"
},
"href": "https://api.spotify.com/v1/artists/5INjqkS1o8h1imAzPqGZBb",
"type": "artist"
}
}
],
"next": "https://api.spotify.com/v1/me/player/recently-played?before=1481661737016&limit=2",
"cursors": {
"after": "1481661844589",
"before": "1481661737016"
},
"limit": 2,
"href": "https://api.spotify.com/v1/me/player/recently-played?limit=2"
}
Loading

0 comments on commit 234ea0f

Please sign in to comment.