lib/rspotify/playlist.rb in rspotify-2.4.0 vs lib/rspotify/playlist.rb in rspotify-2.4.1
- old
+ new
@@ -126,11 +126,11 @@
is_local
end
super(options)
- @path = "users/#{@owner.instance_variable_get('@id')}/"
+ @path = "users/#{@owner.instance_variable_get('@id').gsub('?','')}/"
@path << (@href =~ /\/starred$/ ? 'starred' : "playlists/#{@id}")
end
# Adds one or more tracks to a playlist in user's Spotify account. This method is only available when the
# current user has granted access to the *playlist-modify-public* and *playlist-modify-private* scopes.
@@ -256,10 +256,10 @@
last_track = offset + limit - 1
if @tracks_cache && last_track < 100 && !RSpotify.raw_response
return @tracks_cache[offset..last_track]
end
- url = "#{@path}/tracks?limit=#{limit}&offset=#{offset}"
+ url = "#{@href}/tracks?limit=#{limit}&offset=#{offset}"
url << "&market=#{market}" if market
response = RSpotify.resolve_auth_request(@owner.id, url)
json = RSpotify.raw_response ? JSON.parse(response) : response
tracks = json['items'].select { |i| i['track'] }