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 +4 -4
- data/lib/rspotify/user.rb +13 -4
- data/lib/rspotify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59f5c32eb06239d63c8cc4a4f3e30e4b30405953
|
4
|
+
data.tar.gz: c8da2fe1c24b6b360a325dd3a8b84b0b17f388eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc70b7565b14ca1279ce2d51a09f62d1d215839afe65f8b51838c86dbdcca8c7652c446a5ca80fb2ddf9ba162bdada45bca69b1e9d1275f2ad6d6009728fca14
|
7
|
+
data.tar.gz: 0fe1f6e8aa81db09888e95008fa5766ef857ad273c826010b9c28e18d3b659ea9915e68a3bb86932006cb72fc9ec076f8779314e25b52c6c412a92dc6d8da8ab
|
data/lib/rspotify/user.rb
CHANGED
@@ -122,13 +122,22 @@ module RSpotify
|
|
122
122
|
Track.new response["item"]
|
123
123
|
end
|
124
124
|
|
125
|
-
|
126
|
-
|
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']
|
data/lib/rspotify/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|