Closed PaulOlteanu closed 2 years ago
I think the end result for the user is still gonna be the same - having to handle the search results for the different types independently, so I'm not sure there would be much point to this change (other then perhaps reducing the number of API requests made from 1 per content type per search to one per search)
Is your feature request related to a problem? Please describe. Currently the only way to use the search API is to specify the type of content you'd like to search for (e.g. Track, Album, Artist, etc.). I'd like to search for multiple, or all types of content.
Describe the solution you'd like The search function should take an option of a list of
SearchType
s (e.g.Some(&[SearchType::Album, SearchType::Track])
).I'm not sure how the
SearchResult
would work, perhaps the response could be aPage<SearchResult>
, and haveSearchResult
be an enum with a variant per content type (e.g.SearchResult::Track(FullTrack), SearchResult::Album(SimplifiedAlbum)
, etc.)Edit: An even simpler way would to have
SearchResult
be a struct of options:while less ergonomic, this more accurately represents the actual Spotify API response (I also now see that the pagination wouldn't really be feasible the way I first proposed)