Current approach to iterate over a page #347
Replies: 2 comments
-
Suppose that you are using the pub async fn playlist_tracks<L: Into<Option<u32>>, O: Into<Option<u32>>>(
&self,
playlist_id: &str,
fields: Option<&str>,
limit: L,
offset: O,
market: Option<Country>,
) -> ClientResult<Page<PlaylistItem>> { And the page gives information about the next one though a URL like this: {
"next": "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK/tracks?offset=2&limit=2",
} For now, you have to parse the url and extract I know it's a pity that it's not an elegant and ergonomic solution, probably this could solve the problem you meet :( |
Beta Was this translation helpful? Give feedback.
-
This sure helps for now, I'm really looking forward to #166 getting finished and merged. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I'm currently at a point, where I need all "FullTrack" items of any playlist, by its id. A page gives information about the next one (if available) through a URL. I haven't seen any function in the documentation, which lets me retrieve the next page using this URL. I've seen #166 and I'm hoping to see this feature in rspotify in the future. But what is the best approach for now? Crawling the URL manually with
reqwest
?Beta Was this translation helpful? Give feedback.
All reactions