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

Next field not updating #261

Open
michaelriri opened this issue May 21, 2024 · 1 comment
Open

Next field not updating #261

michaelriri opened this issue May 21, 2024 · 1 comment

Comments

@michaelriri
Copy link

Can someone help my identify what's wrong with this? I'm trying to page through all the search results, but the loop never breaks:

ctx := context.Background()
results, err := client.Search(ctx, "lofi", spotify.SearchTypeTrack|spotify.SearchTypeAlbum|spotify.SearchTypeArtist, spotify.Limit(50))
if err != nil {
	log.Fatal(err)
}
for {
	err = client.NextTrackResults(ctx, results)
	if err == spotify.ErrNoMorePages {
		break
	}
	if err != nil {
		log.Fatal(err)
	}
}

This loop runs infinitely where SearchResult.Tracks.Next stays locked at https://api.spotify.com/v1/search?query=lofi&type=track&offset=950&limit=50.

@michaelriri
Copy link
Author

Am I doing something wrong here?

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

No branches or pull requests

1 participant