rspotify 1.20.0 → 1.21.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: 6a0c24d5567ae501a2521c15ef19a34175dde046
4
- data.tar.gz: 25b8e50e446cce78cfb8f98f232353220454ee0b
3
+ metadata.gz: 5401f81655cd7d706dde9f93f183661753a109b7
4
+ data.tar.gz: a63d95d2af54dee701e1fb28828d3d1d71fe9124
5
5
  SHA512:
6
- metadata.gz: dd7117cec0764a99ec287d42e913bec0634bccd480b53efa4c9418b7e5782785dc81c59b875dafd53f2637ff8e7ec86ecca4a5b743002abf51ab1eb577ab198e
7
- data.tar.gz: 504222a7bb2eb95b18e0e6abf5b1961c789b07411245ed23d1914b7c2de45415224baabeeb015f9dadd0e278c4a2b29c22f3b803dfc89200e5805559bc01914c
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
@@ -1,3 +1,3 @@
1
1
  module RSpotify
2
- VERSION = '1.20.0'
2
+ VERSION = '1.21.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.20.0
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-04-11 00:00:00.000000000 Z
11
+ date: 2017-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2