mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-25 23:45:52 +03:00
[GH-ISSUE #296] Automatically do paginated post requests #89
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#89
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 @nick-lehmann on GitHub (Jan 20, 2022).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/296
Is your feature request related to a problem? Please describe.
After gathering some information from the Spotify API, I tried to add around 300 tracks to a single playlist. I knew that Spotify restricts the number of items that can be passed to an endpoint. For the Add Items to Playlist endpoint, Spotify imposes a limit of a 100 tracks in a single request. The API does not reflect this restriction in any way.
Describe the solution you'd like
While it would be possible to add some type information to functions like playlist_add_items, I would rather prefer that all method do chunking automatically. If the given number of items surpasses the limit of the API, a second request will be sent.
Describe alternatives you've considered
It is quite easy to implement the chunking on my own. However, it is dull and the returned responses with a status code of 400 might surprise some users.
Additional context
I am quite new to Rust and, given you agree to this proposal, I would love to create a PR for this.
@ramsayleung commented on GitHub (Jan 23, 2022):
Hi Nick, this idea sounds great!
Rspotifyjust supports automatically fetch the paginated requests, but it doesn't support automatically feed the paginated requests. It will be great if you could help us add this feature.@marioortizmanero commented on GitHub (Jan 23, 2022):
I think in this case there's no nerd to have a _manual and an iterator version right? Mainly because it doesn't really work with pages. It could just work transparently for user friendliness, as long as it's clearly commented.
@nick-lehmann commented on GitHub (Jan 24, 2022):
@ramsayleung thank you very much, I will try to get a PR going this week 👍🏻
@marioortizmanero I guess there is a always a nerd 😝 But no, I don't think we would need both. I don't see why anyone would need the manual version...
@github-actions[bot] commented on GitHub (Jul 2, 2023):
Message to comment on stale issues. If none provided, will not mark issues stale
@github-actions[bot] commented on GitHub (Nov 29, 2025):
Message to comment on stale issues. If none provided, will not mark issues stale