spotify-client 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 761f9472ffb6923eae1232ebdbdaa10ba3d17d7d
4
- data.tar.gz: 1fd6fc20816d0701a5e8378664a629e85c43202e
3
+ metadata.gz: e7d5bcbac2b7f1892ea9b256eddacb21f963be42
4
+ data.tar.gz: e1ed20dccb1395e60fa612ef230097fcf4354d42
5
5
  SHA512:
6
- metadata.gz: a56d6c85d851cec3fdc0aeaabe550237214fca66aa49f965772286517dde7e7d62fdf70d8d46f4e65af03638fa6a1ec386108d034bf8dafd9e1daa9b0b84f209
7
- data.tar.gz: 478186a536a1a6286767d79771df1bd0819f5c841b612f1875846c7a092de5cd1174d9a2fecb9362a7d86dcdc6a51c2d6ffdcb55c53500f0e279eb0410f4068d
6
+ metadata.gz: d9c59c1aa145001010f8612d9b968e75d4af81348ef995cae4a381982b0b439802b6b77f57b76b8560be654b0b0eae2b08eaa9732bc1c0235dd1123349c2686c
7
+ data.tar.gz: 00db9789740401f76cf06a308bcd5427e926835a82a4b9cd49ce6d7048aa44340ba509f39b8b873542ba696c99f8b9bceda7f17e2a3d4498fe7e65e1e282e3d0
@@ -1,3 +1,3 @@
1
1
  module Spotify
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -53,7 +53,22 @@ module Spotify
53
53
  end
54
54
 
55
55
  def user_playlist_tracks(user_id, playlist_id)
56
- run(:get, "/v1/users/#{user_id}/playlists/#{playlist_id}/tracks", [200])
56
+ tracks = { "items" => [] }
57
+ path = "/v1/users/#{user_id}/playlists/#{playlist_id}/tracks"
58
+
59
+ while path
60
+ response = run(:get, path, [200])
61
+ tracks["items"].concat(response.delete("items"))
62
+ tracks.merge!(response)
63
+
64
+ path = if response["next"]
65
+ response["next"].gsub(BASE_URI, '')
66
+ else
67
+ nil
68
+ end
69
+ end
70
+
71
+ tracks
57
72
  end
58
73
 
59
74
  # Create a playlist for a Spotify user. The playlist will be empty until you add tracks.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spotify-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli