rspotify 2.12.0 → 2.12.2

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
  SHA256:
3
- metadata.gz: 9ad5348b6d88e2e2f36d4f8a08a5979e84cf6b09c0674c65ce49095b7536284d
4
- data.tar.gz: 2a369690af6ad4401c081ff980d156fd31eaa853ab5b36a7a0b4bede28ec53e2
3
+ metadata.gz: 04012caf5022c9b025580adecc490d30ee09f175bc6c45a9c6e467f988983365
4
+ data.tar.gz: c8b22753b1bcf23408d15dbac1abcc6c00bd4ab7fcf17ab9bb3995dc62169403
5
5
  SHA512:
6
- metadata.gz: 1a9f861ce328736c47078c3f64b051621e3c442037c9636e24bf64dbde4c85a7efcc0fb3ec7c85db96fb297b41a7f0a37b20446e0ecfa0d1ab8f23d682c1a202
7
- data.tar.gz: 84e5dcfecd734d927b63a79365b5a4dc0669dec8412028322d19944be7f4995d15a0adaaf4287066de66bf6452c29003fd6a2e6cfa29a1bc2d9a9b8da223b09e
6
+ metadata.gz: e291b857cca5ddbf3d3ae4830b16d5cffd076e23244f7dc305aaa01be89b855420aaa48110dfac96c001693b5ed00f4c137def66c32c5553e58cc8b40d106bd9
7
+ data.tar.gz: 8120e093d6bc7597994a52e2d7d277df932f290a51bdf1f07277454cc2da8d39c69d9e7a6c7f376ed8f65416c7cc1d658047497ffcb75df48d68dbf7aace6c5e
@@ -128,8 +128,11 @@ module RSpotify
128
128
 
129
129
  super(options)
130
130
 
131
- @path = "users/#{@owner.instance_variable_get('@id').gsub('?','')}/"
132
- @path << (@href =~ /\/starred$/ ? 'starred' : "playlists/#{@id}")
131
+ @path = if @href =~ /\/starred$/
132
+ "users/#{@owner.instance_variable_get('@id').gsub('?','')}/starred"
133
+ else
134
+ "playlists/#{@id}"
135
+ end
133
136
  end
134
137
 
135
138
  # Adds one or more tracks to a playlist in user's Spotify account. This method is only available when the
data/lib/rspotify/user.rb CHANGED
@@ -61,8 +61,11 @@ module RSpotify
61
61
  private_class_method :extract_custom_headers
62
62
 
63
63
  def self.oauth_header(user_id)
64
+ token = @@users_credentials.dig(user_id, 'token')
65
+ # Fallback for playlist.add_tracks! if no credentials for the playlist owner exist
66
+ token ||= @@users_credentials.values.dig(0, 'token')
64
67
  {
65
- 'Authorization' => "Bearer #{@@users_credentials[user_id]['token']}",
68
+ 'Authorization' => "Bearer #{token}",
66
69
  'Content-Type' => 'application/json'
67
70
  }
68
71
  end
@@ -1,3 +1,3 @@
1
1
  module RSpotify
2
- VERSION = '2.12.0'.freeze
2
+ VERSION = '2.12.2'.freeze
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: 2.12.0
4
+ version: 2.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Sad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-20 00:00:00.000000000 Z
11
+ date: 2024-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2