rspotify 1.22.1 → 1.23.0

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: c1f2cb1c508d26a9c6309cba7ca13a85e0f20388
4
- data.tar.gz: 5d1f918f508b01cc1063c21950cb057c04fe580f
3
+ metadata.gz: 59f5c32eb06239d63c8cc4a4f3e30e4b30405953
4
+ data.tar.gz: c8da2fe1c24b6b360a325dd3a8b84b0b17f388eb
5
5
  SHA512:
6
- metadata.gz: 8cce89b90a3c547666c6ecca34ebaff3a117fcf68a631faadd963382eeb4eb79472fe310d509597c868b50e08f61932680f89bc23b372daf09cee732890b7d15
7
- data.tar.gz: 6adc0d88e9a2c75a6055671662696718d9bf353e7c78bfd459130ce399804f5ffccd6258f98ddb29edd42534669512258dc8cb2f854d9ec2fb3aded95e374ee3
6
+ metadata.gz: fc70b7565b14ca1279ce2d51a09f62d1d215839afe65f8b51838c86dbdcca8c7652c446a5ca80fb2ddf9ba162bdada45bca69b1e9d1275f2ad6d6009728fca14
7
+ data.tar.gz: 0fe1f6e8aa81db09888e95008fa5766ef857ad273c826010b9c28e18d3b659ea9915e68a3bb86932006cb72fc9ec076f8779314e25b52c6c412a92dc6d8da8ab
@@ -122,13 +122,22 @@ module RSpotify
122
122
  Track.new response["item"]
123
123
  end
124
124
 
125
- def recently_played
126
- url = "me/player/recently-played"
125
+ # Get the current user’s recently played tracks. Requires the *user-read-recently-played* scope.
126
+ #
127
+ # @param limit [Integer] Optional. The number of entities to return. Default: 20. Minimum: 1. Maximum: 50.
128
+ # @return [Array<Track>]
129
+ #
130
+ # @example
131
+ # recently_played = user.recently_played
132
+ # recently_played.size #=> 20
133
+ # recently_played.first.name #=> "Ice to Never"
134
+ def recently_played(limit: 20)
135
+ url = "me/player/recently-played?limit=#{limit}"
127
136
  response = RSpotify.resolve_auth_request(@id, url)
128
137
  return response if RSpotify.raw_response
129
-
138
+
130
139
  json = RSpotify.raw_response ? JSON.parse(response) : response
131
- json['items'].map do |t|
140
+ json['items'].map do |t|
132
141
  data = t['track']
133
142
  data['played_at'] = t['played_at']
134
143
  data['context_type'] = t['context']['type']
@@ -1,3 +1,3 @@
1
1
  module RSpotify
2
- VERSION = '1.22.1'
2
+ VERSION = '1.23.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.1
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Sad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2