rspotify 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/rspotify/base.rb +1 -2
 - data/lib/rspotify/connection.rb +1 -1
 - data/lib/rspotify/player.rb +13 -12
 - data/lib/rspotify/version.rb +1 -1
 - 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: 59c34bf71f214c47a5119f269b79451204658dd8
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b6b7e1e0adb4b392bf3a829d200820a434427142
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 885ac9c2f2b2218e5f31c48ffa9585e5f98496457fb90ab0e5ded962fa26ac2220bc196ae2d7a85258372dc2c31ff598a5a22c46f379ab4a18c33362ebbf352f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 66265e27d689adb88a2336b2be6e724c1e2e49fe4506bf6c84fb8dca801b4148cadfc7a72a89a91d9fac10c081f54100951d874e91146c84831643512abd2437
         
     | 
    
        data/lib/rspotify/base.rb
    CHANGED
    
    | 
         @@ -30,7 +30,6 @@ module RSpotify 
     | 
|
| 
       30 
30 
     | 
    
         
             
                      warn 'Spotify API does not support finding several users simultaneously'
         
     | 
| 
       31 
31 
     | 
    
         
             
                      return false
         
     | 
| 
       32 
32 
     | 
    
         
             
                    end
         
     | 
| 
       33 
     | 
    
         
            -
                    limit = (type == 'album' ? 20 : 50)
         
     | 
| 
       34 
33 
     | 
    
         
             
                    find_many(ids, type, market: market)
         
     | 
| 
       35 
34 
     | 
    
         
             
                  when String
         
     | 
| 
       36 
35 
     | 
    
         
             
                    id = ids
         
     | 
| 
         @@ -143,7 +142,7 @@ module RSpotify 
     | 
|
| 
       143 
142 
     | 
    
         
             
                    frameborder: 0,
         
     | 
| 
       144 
143 
     | 
    
         
             
                    allowtransparency: true,
         
     | 
| 
       145 
144 
     | 
    
         
             
                    view: nil,
         
     | 
| 
       146 
     | 
    
         
            -
                    theme: nil 
     | 
| 
      
 145 
     | 
    
         
            +
                    theme: nil
         
     | 
| 
       147 
146 
     | 
    
         
             
                  }
         
     | 
| 
       148 
147 
     | 
    
         
             
                  options = default_options.merge(options)
         
     | 
| 
       149 
148 
     | 
    
         | 
    
        data/lib/rspotify/connection.rb
    CHANGED
    
    | 
         @@ -9,7 +9,7 @@ module RSpotify 
     | 
|
| 
       9 
9 
     | 
    
         
             
              API_URI       = 'https://api.spotify.com/v1/'.freeze
         
     | 
| 
       10 
10 
     | 
    
         
             
              AUTHORIZE_URI = 'https://accounts.spotify.com/authorize'.freeze
         
     | 
| 
       11 
11 
     | 
    
         
             
              TOKEN_URI     = 'https://accounts.spotify.com/api/token'.freeze
         
     | 
| 
       12 
     | 
    
         
            -
              VERBS         = %w 
     | 
| 
      
 12 
     | 
    
         
            +
              VERBS         = %w[get post put delete].freeze
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
              class << self
         
     | 
| 
       15 
15 
     | 
    
         
             
                attr_accessor :raw_response
         
     | 
    
        data/lib/rspotify/player.rb
    CHANGED
    
    | 
         @@ -4,18 +4,19 @@ module RSpotify 
     | 
|
| 
       4 
4 
     | 
    
         
             
                def initialize(user, options = {})
         
     | 
| 
       5 
5 
     | 
    
         
             
                  @user = user
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
                  @repeat_state 
     | 
| 
       8 
     | 
    
         
            -
                  @shuffle_state 
     | 
| 
       9 
     | 
    
         
            -
                  @progress 
     | 
| 
       10 
     | 
    
         
            -
                  @is_playing 
     | 
| 
      
 7 
     | 
    
         
            +
                  @repeat_state           = options['repeat_state']
         
     | 
| 
      
 8 
     | 
    
         
            +
                  @shuffle_state          = options['shuffle_state']
         
     | 
| 
      
 9 
     | 
    
         
            +
                  @progress               = options['progress_ms']
         
     | 
| 
      
 10 
     | 
    
         
            +
                  @is_playing             = options['is_playing']
         
     | 
| 
      
 11 
     | 
    
         
            +
                  @currently_playing_type = options['currently_playing_type']
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
13 
     | 
    
         
             
                  @track = if options['track']
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 14 
     | 
    
         
            +
                    Track.new options['track']
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
       16 
17 
     | 
    
         
             
                  @device = if options['device']
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 18 
     | 
    
         
            +
                    Device.new options['device']
         
     | 
| 
      
 19 
     | 
    
         
            +
                  end
         
     | 
| 
       19 
20 
     | 
    
         
             
                end
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
       21 
22 
     | 
    
         
             
                def playing?
         
     | 
| 
         @@ -28,7 +29,7 @@ module RSpotify 
     | 
|
| 
       28 
29 
     | 
    
         
             
                # @example
         
     | 
| 
       29 
30 
     | 
    
         
             
                #           player = user.player
         
     | 
| 
       30 
31 
     | 
    
         
             
                #           player.play_context(nil,"spotify:album:1Je1IMUlBXcx1Fz0WE7oPT")
         
     | 
| 
       31 
     | 
    
         
            -
                def play_context(device_id=nil, uri)
         
     | 
| 
      
 32 
     | 
    
         
            +
                def play_context(device_id = nil, uri)
         
     | 
| 
       32 
33 
     | 
    
         
             
                  params = {"context_uri": uri}
         
     | 
| 
       33 
34 
     | 
    
         
             
                  play(device_id, params)
         
     | 
| 
       34 
35 
     | 
    
         
             
                end
         
     | 
| 
         @@ -40,7 +41,7 @@ module RSpotify 
     | 
|
| 
       40 
41 
     | 
    
         
             
                #           player = user.player
         
     | 
| 
       41 
42 
     | 
    
         
             
                #           tracks_uris = ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]
         
     | 
| 
       42 
43 
     | 
    
         
             
                #           player.play_tracks(nil, tracks_uris)
         
     | 
| 
       43 
     | 
    
         
            -
                def play_tracks(device_id=nil, uris)
         
     | 
| 
      
 44 
     | 
    
         
            +
                def play_tracks(device_id = nil, uris)
         
     | 
| 
       44 
45 
     | 
    
         
             
                  params = {"uris": uris}
         
     | 
| 
       45 
46 
     | 
    
         
             
                  play(device_id, params)
         
     | 
| 
       46 
47 
     | 
    
         
             
                end
         
     | 
| 
         @@ -52,7 +53,7 @@ module RSpotify 
     | 
|
| 
       52 
53 
     | 
    
         
             
                #           player = user.player
         
     | 
| 
       53 
54 
     | 
    
         
             
                #           player.play_track(nil, "spotify:track:4iV5W9uYEdYUVa79Axb7Rh")
         
     | 
| 
       54 
55 
     | 
    
         
             
                #           # User must be a premium subscriber for this feature to work.
         
     | 
| 
       55 
     | 
    
         
            -
                def play_track(device_id=nil, uri)
         
     | 
| 
      
 56 
     | 
    
         
            +
                def play_track(device_id = nil, uri)
         
     | 
| 
       56 
57 
     | 
    
         
             
                  params = {"uris": [uri]}
         
     | 
| 
       57 
58 
     | 
    
         
             
                  play(device_id, params)
         
     | 
| 
       58 
59 
     | 
    
         
             
                end
         
     | 
| 
         @@ -65,7 +66,7 @@ module RSpotify 
     | 
|
| 
       65 
66 
     | 
    
         
             
                #           player.play
         
     | 
| 
       66 
67 
     | 
    
         
             
                def play(device_id = nil, params = {})
         
     | 
| 
       67 
68 
     | 
    
         
             
                  url = "me/player/play"
         
     | 
| 
       68 
     | 
    
         
            -
                  url = device_id.nil? ? url : url 
     | 
| 
      
 69 
     | 
    
         
            +
                  url = device_id.nil? ? url : "#{url}?device_id=#{device_id}"
         
     | 
| 
       69 
70 
     | 
    
         | 
| 
       70 
71 
     | 
    
         
             
                  User.oauth_put(@user.id, url, params.to_json)
         
     | 
| 
       71 
72 
     | 
    
         
             
                end
         
     | 
    
        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.6. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.6.1
         
     | 
| 
       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-11-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: omniauth-oauth2
         
     |