guilhermesad / rspotify

A ruby wrapper for the Spotify Web API
MIT License
717 stars 290 forks source link

Adding tracks to playlists raises NameError? #251

Open depesz opened 2 years ago

depesz commented 2 years ago

So, I did:

RSpotify.authenticate("...", "...")
fool = RSpotify::User.find('depesz').playlists.first
albums = RSpotify::Artist.search('F.O.O.L').first.albums(limit: 33)
albums.each { |x| puts "== #{x.name}"; fool.add_tracks!( x.tracks ) };

It didn't add any tracks, and ended immediately with:

NameError: uninitialized class variable @@users_credentials in RSpotify::User
from /home/depesz/.local/share/gem/gems/rspotify-2.11.1/lib/rspotify/user.rb:65:in `oauth_header'

Clearly I must have done something wrong, but what?