rspotify 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rspotify/user.rb +9 -2
- 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: 5401f81655cd7d706dde9f93f183661753a109b7
|
4
|
+
data.tar.gz: a63d95d2af54dee701e1fb28828d3d1d71fe9124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888b12960363e50b95cf1729298312beb99b8876626afd37472afc28d6c6de266ce5b5ba7beb7afc8ebf47aa83bf50fa3a89dc8566f674168ba9e07eaa40b8cc
|
7
|
+
data.tar.gz: 176d975c4012163ed91f0ec8b3f1949b32f7c918a943a7bfa5f2a86b676c595c1a05bbd308407c4b8da60b62123864121f0e25812037d50202a1d34ce6ecd5f1
|
data/lib/rspotify/user.rb
CHANGED
@@ -115,6 +115,13 @@ module RSpotify
|
|
115
115
|
Playlist.new response
|
116
116
|
end
|
117
117
|
|
118
|
+
def currently_playing
|
119
|
+
url = "me/player/currently-playing"
|
120
|
+
response = RSpotify.resolve_auth_request(@id, url)
|
121
|
+
return response if RSpotify.raw_response
|
122
|
+
Track.new response["item"]
|
123
|
+
end
|
124
|
+
|
118
125
|
# Add the current user as a follower of one or more artists, other Spotify users or a playlist. Following artists or users require the *user-follow-modify*
|
119
126
|
# scope. Following a playlist publicly requires the *playlist-modify-public* scope; following it privately requires the *playlist-modify-private* scope.
|
120
127
|
#
|
@@ -383,7 +390,7 @@ module RSpotify
|
|
383
390
|
# top_artists.first.name #=> "Nine Inch Nails"
|
384
391
|
def top_artists(limit: 20, offset: 0, time_range: 'medium_term')
|
385
392
|
url = "me/top/artists?limit=#{limit}&offset=#{offset}&time_range=#{time_range}"
|
386
|
-
response = User.oauth_get(@id, url)
|
393
|
+
response = User.oauth_get(@id, url)
|
387
394
|
return response if RSpotify.raw_response
|
388
395
|
response['items'].map { |i| Artist.new i }
|
389
396
|
end
|
@@ -401,7 +408,7 @@ module RSpotify
|
|
401
408
|
# top_tracks.first.name #=> "Ice to Never"
|
402
409
|
def top_tracks(limit: 20, offset: 0, time_range: 'medium_term')
|
403
410
|
url = "me/top/tracks?limit=#{limit}&offset=#{offset}&time_range=#{time_range}"
|
404
|
-
response = User.oauth_get(@id, url)
|
411
|
+
response = User.oauth_get(@id, url)
|
405
412
|
return response if RSpotify.raw_response
|
406
413
|
response['items'].map { |i| Track.new i }
|
407
414
|
end
|
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.21.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-
|
11
|
+
date: 2017-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|