rspotify 2.12.2 → 2.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspotify/connection.rb +6 -1
- data/lib/rspotify/user.rb +4 -4
- data/lib/rspotify/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3c335836ebeac5a9dd5aa52e70a83b28e4051ae80fad6856e7a7e1317fb22e
|
4
|
+
data.tar.gz: 9cf0e4605d15d3e28bf5aec69f63a5f9ce8a286a0b6d11715d24ec5a8e636223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 787a8cd27268fc21c0175f5285dc015fe92905ae18cedbe5d7cc3763907133e7f343d56cb00cd67d20a1342de9827974b24a522f12e39af3d96496d20a45e98a
|
7
|
+
data.tar.gz: b872b4cf241c516413dfc1811ccae3c21e020f44a3c4727f340635353acb93bbadd25187b4cd5c348217ab19635a1daf98dc02027be3164836a69371fd3d25f7
|
data/lib/rspotify/connection.rb
CHANGED
@@ -78,7 +78,12 @@ module RSpotify
|
|
78
78
|
end
|
79
79
|
|
80
80
|
return response if raw_response
|
81
|
-
|
81
|
+
|
82
|
+
begin
|
83
|
+
JSON.parse(response) unless response.nil? || response.empty?
|
84
|
+
rescue JSON::ParserError, TypeError => e
|
85
|
+
response.to_s # Fall back to raw body when the response is not actually a valid JSON response
|
86
|
+
end
|
82
87
|
end
|
83
88
|
|
84
89
|
# Added this method for testing
|
data/lib/rspotify/user.rb
CHANGED
@@ -317,8 +317,8 @@ module RSpotify
|
|
317
317
|
def save_tracks!(tracks)
|
318
318
|
tracks_ids = tracks.map(&:id)
|
319
319
|
url = "me/tracks"
|
320
|
-
request_body = tracks_ids
|
321
|
-
User.oauth_put(@id, url, request_body)
|
320
|
+
request_body = { ids: tracks_ids }
|
321
|
+
User.oauth_put(@id, url, request_body.to_json)
|
322
322
|
tracks
|
323
323
|
end
|
324
324
|
|
@@ -394,8 +394,8 @@ module RSpotify
|
|
394
394
|
def save_albums!(albums)
|
395
395
|
albums_ids = albums.map(&:id)
|
396
396
|
url = "me/albums"
|
397
|
-
request_body = albums_ids
|
398
|
-
User.oauth_put(@id, url, request_body)
|
397
|
+
request_body = { ids: albums_ids }
|
398
|
+
User.oauth_put(@id, url, request_body.to_json)
|
399
399
|
albums
|
400
400
|
end
|
401
401
|
|
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: 2.12.
|
4
|
+
version: 2.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Sad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
301
|
- !ruby/object:Gem::Version
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
|
-
rubygems_version: 3.
|
304
|
+
rubygems_version: 3.3.27
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: A ruby wrapper for the Spotify Web API
|