Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show search returns nil items #253

Open
domchristie opened this issue Jun 4, 2022 · 1 comment
Open

Show search returns nil items #253

domchristie opened this issue Jun 4, 2022 · 1 comment

Comments

@domchristie
Copy link

Hey, I'm trying to perform a basic Show search. I authenticate with my credentials and call the search method, however, the items array in the response is just a load of nils and so it throws an error when attempting to initialize a Show:

RSpotify.authenticate("…", "…")
# => true
RSpotify::Show.search("NPR")

Throws:

rspotify/show.rb:48:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)

Any pointers for a fix?

Many thanks!

Salanoid added a commit to Salanoid/rspotify that referenced this issue Dec 27, 2022
@ZackAttax
Copy link

ZackAttax commented Nov 29, 2023

Seems like a market is necessary but it's not very clear.

From the API docs :

market
string
An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.
If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.
Note: If neither market or user country are provided, the content is considered unavailable for the client.
Users can view the country that is associated with their account in the account settings.

Example: market=ES

Making an API request in the docs you get "href"=>"https://api.spotify.com/v1/search?query=foo&type=show&locale=en-US%2Cen%3Bq%3D0.9%2Cla%3Bq%3D0.8&offset=0&limit=20"

using the gem you get "href"=>"https://api.spotify.com/v1/search?query=foo&type=show&offset=0&limit=20"

I added a market and was able to get a response in the items key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants