mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[GH-ISSUE #313] A way to search for multiple types of content #96
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PaulOlteanu on GitHub (Apr 27, 2022).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/313
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
SearchTypes (e.g.Some(&[SearchType::Album, SearchType::Track])).I'm not sure how the
SearchResultwould work, perhaps the response could be aPage<SearchResult>, and haveSearchResultbe 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
SearchResultbe 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)
@PaulOlteanu commented on GitHub (Apr 28, 2022):
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)