rspotify 2.12.1 → 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: 6aa870c1626f1912080858169ae6dfaedcaa3d80b1a054b90d045a0674717cbe
4
- data.tar.gz: 3f3b4138467008192be294bee7afdc0d1c0970bedf6410eb8262fb6567e6b34f
3
+ metadata.gz: 04012caf5022c9b025580adecc490d30ee09f175bc6c45a9c6e467f988983365
4
+ data.tar.gz: c8b22753b1bcf23408d15dbac1abcc6c00bd4ab7fcf17ab9bb3995dc62169403
5
5
  SHA512:
6
- metadata.gz: '09746a6f4b21b8ff50877afaed94c34332e2cb6ac34df5c1a3b599d68cc92bbe8314f287432da0a018d38002d662c9704f784e0662dee7a531d02a54a76e6fc2'
7
- data.tar.gz: 4574ab6c8f9a6ec06ab058cbdb611179275933fa2a57c755567df6c467a9fb7d017e33a68a1e4b3208c406741832d7009c9ad138b33817b5b115eeb54f961558
6
+ metadata.gz: e291b857cca5ddbf3d3ae4830b16d5cffd076e23244f7dc305aaa01be89b855420aaa48110dfac96c001693b5ed00f4c137def66c32c5553e58cc8b40d106bd9
7
+ data.tar.gz: 8120e093d6bc7597994a52e2d7d277df932f290a51bdf1f07277454cc2da8d39c69d9e7a6c7f376ed8f65416c7cc1d658047497ffcb75df48d68dbf7aace6c5e
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.1'.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.1
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: 2024-05-03 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