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

total parameter should refer to all types in search_markets method #534

Closed
stephanebruckert opened this issue Jul 7, 2020 · 2 comments
Closed

Comments

@stephanebruckert
Copy link
Member

Currently we can stop searching all markets when an total results are found. However this only applies to the first search type when multiple types are given:

search_markets("abba", type="artist,track", total=10) 

https://github.com/plamere/spotipy/blob/f7fb8757e958ee055cf39764ff7070f9d67b7229/spotipy/client.py#L541

@quanuw
Copy link

quanuw commented Apr 11, 2021

Hello, I'm new to this project and would like to contribute! Can I be assigned to this issue @stephanebruckert?

@rngolam
Copy link
Contributor

rngolam commented Nov 27, 2022

Hi @stephanebruckert, I'm currently looking into this issue and just want to clarify the desired behavior.

The limit parameter specifies the number of items to be returned for each search type. The code will currently truncate the limit as the item count approaches total. But what should happen when multiple types are specified?

For example, if the user enters this query:

search_markets("abba", limit=10, type="artist,track", total=25)

The code will search the first market for 10 artist items followed by 10 track items, bringing the count to 20. At this point, we want to truncate the limit to 5 prior to searching the next market. But should we still get 5 items for both artists and tracks, resulting in a count of 30 items? Or do we just want to get the 5 artists items and immediately return the 25 results at this point (which would result in the second market having no tracks property)?

Thanks!

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

No branches or pull requests

3 participants