Skip to content

Commit

Permalink
Merge pull request #261 from carlosefonseca/fix-playlists-path
Browse files Browse the repository at this point in the history
Fix the playlist path that could cause errors
  • Loading branch information
guilhermesad authored May 3, 2024
2 parents 4a994cc + 89a1d67 commit 1ad7964
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rspotify/playlist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ def initialize(options = {})

super(options)

@path = "users/#{@owner.instance_variable_get('@id').gsub('?','')}/"
@path << (@href =~ /\/starred$/ ? 'starred' : "playlists/#{@id}")
@path = if @href =~ /\/starred$/
"users/#{@owner.instance_variable_get('@id').gsub('?','')}/starred"
else
"playlists/#{@id}"
end
end

# Adds one or more tracks to a playlist in user's Spotify account. This method is only available when the
Expand Down

0 comments on commit 1ad7964

Please sign in to comment.