mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #483] [MERGED] Fix unnecessary request in sync pagination #486
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#486
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?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/483
Author: @thirteenowls
Created: 5/22/2024
Status: ✅ Merged
Merged: 5/25/2024
Merged by: @ramsayleung
Base:
master← Head:fix-extra-request📝 Commits (1)
864a781Fix unnecessary request in sync pagination📊 Changes
1 file changed (+10 additions, -6 deletions)
View changed files
📝
src/clients/pagination/iter.rs(+10 -6)📄 Description
Description
Makes use of the
nextfield to end pagination early, instead of waiting for Spotify's API to return no data.Motivation and Context
Currently,
PageIteratoralways sends one extra request to the API, because it does not checknextto know if more data is available (unlike its async equivalent).Dependencies
None.
Type of change
Please delete options that are not relevant.
How has this been tested?
This has been tested by adding a
dbg!call right before sending a request inPageIterator's impl, then running thepagination_syncexample with and without this change.Tests were run using an account with 51 saved tracks, which should require two requests with
limitset to 50.This is
pagination_sync's output before the change:And this is its output after the change:
The output is the same, but the extraneous request has been eliminated.
Is this change properly documented?
N/A
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.