rspotify | Spotify Web API SDK implemented in Rust | REST library
kandi X-RAY | rspotify Summary
kandi X-RAY | rspotify Summary
Rspotify is a wrapper for the Spotify Web API, inspired by spotipy. It includes support for all the authorization flows, and helper functions for all endpoints. To learn how to use Rspotify, please refer to the documentation. There are some examples that may be useful as well.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rspotify
rspotify Key Features
rspotify Examples and Code Snippets
Community Discussions
Trending Discussions on rspotify
QUESTION
I'm trying to wrap my head around why a problem I was struggling with is now magically resolved.
I am building a Rails app that uses Spotify OAuth (via the rspotify
gem) and became stuck on the exact issue described here. After spinning my wheels, I finally came across this comment, recommending that I explicitly add the omniauth
gem to my Gemfile
.
Now, this omniauth
gem was already a dependency in Gemfile.lock
for omniauth-oauth2
specifically. As the linked comment recommends, I included omniauth
in my Gemfile and now my problem is seemingly resolved, but I don't really know why.
- Why does including a gem in your
Gemfile
resolve a railtie issue in this case? - If a gem is already installed as a dependency (according to
Gemfile.lock
) isn't that evidence that a given gem was installed? If, say,gem_foo
is listed as a dependency inGemfile.lock
and I addgem_foo
inGemfile
and then run Bundler, how does Rails interpret this change?
ANSWER
Answered 2022-Feb-07 at 08:06This is related to how gems
are loaded by bundler. Bundler.require
requires gems listed in Gemfile
but does not require its dependecy. Its upto the library to require/load its dependency.
The mentioned issue happens when omniauth
is not added explicitly to Gemfile, hence bundler does not require it.
But since omniauth-rails_csrf_protection
assumes the ominauth
is already required, it errors out when user only adds omniauth-rails_csrf_protection
but does not add omniauth
to Gemfile.
I have created a possible fix for the issue https://github.com/cookpad/omniauth-rails_csrf_protection/pull/13
UPDATE: The is fix has been merged in the gem repo.
QUESTION
I'm using Spotify developer API from a webapplication I'm developing in Ruby on Rails. For that I'm using a gem called rspotify. I modified it slightly in order to add the capability to queue a song which is offered by the Spotify API. Here is the API documentation from Spotify Dev: https://developer.spotify.com/console/post-queue/
Here is the original piece of code from rspotify with all existing (and working) calls (like play a song): https://github.com/guilhermesad/rspotify/blob/master/lib/rspotify/player.rb
And here is the piece of code I added:
...ANSWER
Answered 2020-May-30 at 17:03Problem is solved.
The issue was coming from the fact that a PUT method was used instead of a POST. Here is the fixed code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rspotify
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page