rspotify 1.25.1 → 1.26.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 +30 -2
- data/lib/rspotify/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc5d8b598c4b640f11fbb275717b5c9935416df
|
4
|
+
data.tar.gz: dbf190b220aaa14fe3a1d2b145f966da8f517b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc831e87cd9e4510ed841aa51ae79c29a4188dde8ff339572d31fc2ec934dc53ae60e0af0282ca10a02c48b9c44bb7770cbcd412b946b21493579d04d4eb5bf4
|
7
|
+
data.tar.gz: 2c3775293b7ccac518b71f3bb894957db0039e862bc938c96b6613b6ede5b9e7f7435346ebbd16d5979490528b8e2ed2a38036342bce8abb3f6f581a25fb95ff
|
data/lib/rspotify/user.rb
CHANGED
@@ -126,9 +126,37 @@ module RSpotify
|
|
126
126
|
# User must be a premium subscriber for this feature to work.
|
127
127
|
def play_track(song_uri)
|
128
128
|
url = "me/player/play"
|
129
|
-
verb = 'put'
|
130
129
|
params = {"uris": [song_uri]}
|
131
|
-
|
130
|
+
User.oauth_put(@id, url, params.to_json)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Play the user's currently active player
|
134
|
+
#
|
135
|
+
# @example
|
136
|
+
# player = user.player
|
137
|
+
# player.play
|
138
|
+
def play
|
139
|
+
url = 'me/player/play'
|
140
|
+
User.oauth_put(@id, url, {})
|
141
|
+
end
|
142
|
+
|
143
|
+
# Pause the user's currently active player
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
# player = user.player
|
147
|
+
# player.pause
|
148
|
+
def pause
|
149
|
+
url = 'me/player/pause'
|
150
|
+
User.oauth_put(@id, url, {})
|
151
|
+
end
|
152
|
+
|
153
|
+
# Get the current user’s player
|
154
|
+
#
|
155
|
+
# @example
|
156
|
+
# player = user.player
|
157
|
+
def player
|
158
|
+
url = 'me/player'
|
159
|
+
User.oauth_get(@id, url)
|
132
160
|
end
|
133
161
|
|
134
162
|
# Get the current user’s recently played tracks. Requires the *user-read-recently-played* scope.
|
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.26.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: 2018-01-
|
11
|
+
date: 2018-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -342,3 +342,4 @@ test_files:
|
|
342
342
|
- spec/vcr_cassettes/user_find_spotify.yml
|
343
343
|
- spec/vcr_cassettes/user_find_wizzler.yml
|
344
344
|
- spec/vcr_cassettes/user_wizzler_playlists_limit_20_offset_0.yml
|
345
|
+
has_rdoc:
|