rspotify 2.4.1 → 2.5.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/album.rb +2 -0
- data/lib/rspotify/player.rb +20 -0
- data/lib/rspotify/version.rb +1 -1
- data/spec/lib/rspotify/album_spec.rb +2 -2
- data/spec/vcr_cassettes/album_find_5bU1XKYxHhEwukllT20xtk.yml +172 -81
- 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: e109369a08f44ff26605781f94c334eabf9adebb
|
4
|
+
data.tar.gz: 052a974c33f640fd724830308517f55a87496f8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38acfebceb65b64f604ec374f25798d7c8a825e3ca8b4e04b76c0f51a3c8d60e1ba44d6263cad3422dacbd8b9b58b7fdf28a2d6ee58eae224fb5d4e07d254d22
|
7
|
+
data.tar.gz: dcb54349b342b67acd931ca7ac57e7ef9d02b30d958f56b898db88388aa9407729b1cbead35307142a996346e61ae8f5a05e912f8629947c0cc71293ef3c213c
|
data/lib/rspotify/album.rb
CHANGED
@@ -7,6 +7,7 @@ module RSpotify
|
|
7
7
|
# @attr [Hash] external_ids Known external IDs for the album
|
8
8
|
# @attr [Array<String>] genres A list of the genres used to classify the album. If not yet classified, the array is empty
|
9
9
|
# @attr [Array<Hash>] images The cover art for the album in various sizes, widest first
|
10
|
+
# @attr [String] label The label for the album
|
10
11
|
# @attr [String] name The name of the album
|
11
12
|
# @attr [Integer] popularity The popularity of the album. The value will be between 0 and 100, with 100 being the most popular
|
12
13
|
# @attr [String] release_date The date the album was first released, for example "1981-12-15". Depending on the precision, it might be shown as "1981" or "1981-12"
|
@@ -77,6 +78,7 @@ module RSpotify
|
|
77
78
|
@external_ids = options['external_ids']
|
78
79
|
@genres = options['genres']
|
79
80
|
@images = options['images']
|
81
|
+
@label = options['label']
|
80
82
|
@name = options['name']
|
81
83
|
@popularity = options['popularity']
|
82
84
|
@release_date = options['release_date']
|
data/lib/rspotify/player.rb
CHANGED
@@ -80,6 +80,26 @@ module RSpotify
|
|
80
80
|
User.oauth_put(@user.id, url, {})
|
81
81
|
end
|
82
82
|
|
83
|
+
# Skip User’s Playback To Next Track
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
# player = user.player
|
87
|
+
# player.next
|
88
|
+
def next
|
89
|
+
url = 'me/player/next'
|
90
|
+
User.oauth_post(@user.id, url, {})
|
91
|
+
end
|
92
|
+
|
93
|
+
# Skip User’s Playback To Previous Track
|
94
|
+
#
|
95
|
+
# @example
|
96
|
+
# player = user.player
|
97
|
+
# player.previous
|
98
|
+
def previous
|
99
|
+
url = 'me/player/previous'
|
100
|
+
User.oauth_post(@user.id, url, {})
|
101
|
+
end
|
102
|
+
|
83
103
|
# Update the user's currently active player volume
|
84
104
|
#
|
85
105
|
# @example
|
data/lib/rspotify/version.rb
CHANGED
@@ -11,14 +11,14 @@ describe RSpotify::Album do
|
|
11
11
|
|
12
12
|
it 'should find album with correct attributes' do
|
13
13
|
expect(@album.album_type) .to eq 'album'
|
14
|
-
expect(@album.available_markets) .to include *%w(AD AT BE BG CA EE ES FR GR MC TW US)
|
15
14
|
expect(@album.copyrights) .to include ({'text' => '2013 Domino Recording Co Ltd', 'type' => 'C'})
|
16
15
|
expect(@album.external_ids['upc']) .to eq '887828031795'
|
17
16
|
expect(@album.external_urls['spotify']) .to eq 'https://open.spotify.com/album/5bU1XKYxHhEwukllT20xtk'
|
18
17
|
expect(@album.genres) .to be_an Array
|
19
18
|
expect(@album.href) .to eq 'https://api.spotify.com/v1/albums/5bU1XKYxHhEwukllT20xtk'
|
20
19
|
expect(@album.id) .to eq '5bU1XKYxHhEwukllT20xtk'
|
21
|
-
expect(@album.images) .to include ({'height' => 640, 'width' => 640, 'url' => 'https://i.scdn.co/image/
|
20
|
+
expect(@album.images) .to include ({'height' => 640, 'width' => 640, 'url' => 'https://i.scdn.co/image/486391b05384f2299a4c01b7bd8d5b855f20def9'})
|
21
|
+
expect(@album.label) .to eq 'Domino Recording Co'
|
22
22
|
expect(@album.name) .to eq 'AM'
|
23
23
|
expect(@album.popularity) .to be > 0
|
24
24
|
expect(@album.release_date) .to eq '2013-09-09'
|
@@ -7,102 +7,193 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
-
|
11
|
-
- "
|
12
|
-
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
13
|
- gzip, deflate
|
14
|
-
|
15
|
-
-
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
16
|
+
Authorization:
|
17
|
+
- Bearer BQBj_AiSFlKCkNIMbCWEYjuJLl6n76QmVsHU6MGDgTUBLZqNiKZ4ALs6Kvm6ulbsW9O81JDdIHyXBndXyhUOxg
|
18
|
+
Host:
|
19
|
+
- api.spotify.com
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 401
|
23
|
+
message: Unauthorized
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
- application/json
|
28
|
+
Www-Authenticate:
|
29
|
+
- Bearer realm="spotify", error="invalid_token", error_description="The access
|
30
|
+
token expired"
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Headers:
|
34
|
+
- Accept, Authorization, Origin, Content-Type, Retry-After
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, POST, OPTIONS, PUT, DELETE, PATCH
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Access-Control-Max-Age:
|
40
|
+
- '604800'
|
41
|
+
Content-Encoding:
|
42
|
+
- gzip
|
43
|
+
Date:
|
44
|
+
- Thu, 28 Feb 2019 14:30:18 GMT
|
45
|
+
Via:
|
46
|
+
- 1.1 google
|
47
|
+
Alt-Svc:
|
48
|
+
- clear
|
49
|
+
Transfer-Encoding:
|
50
|
+
- chunked
|
51
|
+
body:
|
52
|
+
encoding: ASCII-8BIT
|
53
|
+
string: !binary |-
|
54
|
+
H4sIAAAAAAAAAKrmUlBQSi0qyi9SslKoBnKA3OKSxJLSYiDfxMBQByKUm1pc
|
55
|
+
nJieChRTCslIVUhMTgYKKJTkZ6fmKaRWFGQWpaYoAVXWctUCAAAA//8DAFAZ
|
56
|
+
BolRAAAA
|
57
|
+
http_version:
|
58
|
+
recorded_at: Thu, 28 Feb 2019 14:30:28 GMT
|
59
|
+
- request:
|
60
|
+
method: post
|
61
|
+
uri: https://accounts.spotify.com/api/token
|
62
|
+
body:
|
63
|
+
encoding: UTF-8
|
64
|
+
string: grant_type=client_credentials
|
65
|
+
headers:
|
66
|
+
Accept:
|
67
|
+
- "*/*"
|
68
|
+
Accept-Encoding:
|
69
|
+
- gzip, deflate
|
70
|
+
User-Agent:
|
71
|
+
- rest-client/2.0.2 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
72
|
+
Authorization:
|
73
|
+
- Basic NWFjMWNkYTJhZDM1NGFlYWExYWQyNjkzZDMzYmI5OGM6MTU1ZmMwMzhhODU4NDA2NzliNTVhMTgyMmVmMzZiOWI=
|
74
|
+
Content-Length:
|
75
|
+
- '29'
|
76
|
+
Content-Type:
|
77
|
+
- application/x-www-form-urlencoded
|
78
|
+
Host:
|
79
|
+
- accounts.spotify.com
|
16
80
|
response:
|
17
81
|
status:
|
18
82
|
code: 200
|
19
83
|
message: OK
|
20
84
|
headers:
|
21
|
-
|
85
|
+
Server:
|
22
86
|
- nginx
|
23
|
-
|
24
|
-
-
|
25
|
-
|
26
|
-
- application/json
|
27
|
-
|
87
|
+
Date:
|
88
|
+
- Thu, 28 Feb 2019 14:30:18 GMT
|
89
|
+
Content-Type:
|
90
|
+
- application/json
|
91
|
+
Transfer-Encoding:
|
28
92
|
- chunked
|
29
|
-
|
93
|
+
Connection:
|
30
94
|
- keep-alive
|
31
|
-
|
95
|
+
Keep-Alive:
|
32
96
|
- timeout=600
|
33
|
-
|
97
|
+
Vary:
|
34
98
|
- Accept-Encoding
|
35
|
-
|
99
|
+
X-Content-Type-Options:
|
100
|
+
- nosniff
|
101
|
+
Strict-Transport-Security:
|
102
|
+
- max-age=31536000
|
103
|
+
Content-Encoding:
|
104
|
+
- gzip
|
105
|
+
body:
|
106
|
+
encoding: ASCII-8BIT
|
107
|
+
string: !binary |-
|
108
|
+
H4sIAAAAAAAAAx2NTQuCQBQA/8s7K4iCULcNyTYUyTLRi8jyxI/VJ7uLGdF/
|
109
|
+
z7wOw8wHaiFQ68rQgBMc4XRjrYyKqJ6WQxjmsdMbEa88z/hADBuPBONjYttu
|
110
|
+
+3qWlNxL9Sh89EwwZ0FzlTK9uKMq0p4kzxdahuzMwIK9Xpn3jP8F1grVRnGd
|
111
|
+
O4W66rax5zuOBVrQrsD3B4ZH4qaZAAAA
|
112
|
+
http_version:
|
113
|
+
recorded_at: Thu, 28 Feb 2019 14:30:29 GMT
|
114
|
+
- request:
|
115
|
+
method: get
|
116
|
+
uri: https://api.spotify.com/v1/albums/5bU1XKYxHhEwukllT20xtk
|
117
|
+
body:
|
118
|
+
encoding: US-ASCII
|
119
|
+
string: ''
|
120
|
+
headers:
|
121
|
+
Accept:
|
122
|
+
- "*/*"
|
123
|
+
Accept-Encoding:
|
124
|
+
- gzip, deflate
|
125
|
+
User-Agent:
|
126
|
+
- rest-client/2.0.2 (darwin16.1.0 x86_64) ruby/2.3.3p222
|
127
|
+
Authorization:
|
128
|
+
- Bearer BQAhlLYLanv9GGWM0jtcMxIWUIkoAef3ocAImO--2hwVZoOSZrTY6e3tDpUDfJllRH2mrYRjolIWvovkUFA
|
129
|
+
Host:
|
130
|
+
- api.spotify.com
|
131
|
+
response:
|
132
|
+
status:
|
133
|
+
code: 200
|
134
|
+
message: OK
|
135
|
+
headers:
|
136
|
+
Content-Type:
|
137
|
+
- application/json; charset=utf-8
|
138
|
+
Cache-Control:
|
36
139
|
- public, max-age=7200
|
37
|
-
|
38
|
-
- Accept, Authorization, Origin, Content-Type
|
39
|
-
access-control-allow-origin:
|
140
|
+
Access-Control-Allow-Origin:
|
40
141
|
- "*"
|
41
|
-
|
42
|
-
-
|
43
|
-
|
44
|
-
- GET, POST, OPTIONS, PUT, DELETE
|
45
|
-
|
142
|
+
Access-Control-Allow-Headers:
|
143
|
+
- Accept, Authorization, Origin, Content-Type, Retry-After
|
144
|
+
Access-Control-Allow-Methods:
|
145
|
+
- GET, POST, OPTIONS, PUT, DELETE, PATCH
|
146
|
+
Access-Control-Allow-Credentials:
|
46
147
|
- 'true'
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
- max-age=31536000;
|
51
|
-
content-encoding:
|
148
|
+
Access-Control-Max-Age:
|
149
|
+
- '604800'
|
150
|
+
Content-Encoding:
|
52
151
|
- gzip
|
152
|
+
Date:
|
153
|
+
- Thu, 28 Feb 2019 14:30:19 GMT
|
154
|
+
Via:
|
155
|
+
- 1.1 google
|
156
|
+
Alt-Svc:
|
157
|
+
- clear
|
158
|
+
Transfer-Encoding:
|
159
|
+
- chunked
|
53
160
|
body:
|
54
161
|
encoding: ASCII-8BIT
|
55
162
|
string: !binary |-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
idX42o7s1sBI6WXhZYMtoKTdEYeF3R5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wAAAP//AwBlSAYFFTIAAA==
|
197
|
+
http_version:
|
198
|
+
recorded_at: Thu, 28 Feb 2019 14:30:29 GMT
|
199
|
+
recorded_with: VCR 3.0.3
|
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: 2.
|
4
|
+
version: 2.5.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: 2019-
|
11
|
+
date: 2019-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|