spotify_cli/endpoints/playlists/
get_current_user_playlists.rs1use crate::http::api::SpotifyApi;
5use crate::http::client::HttpError;
6use crate::http::endpoints::Endpoint;
7use serde_json::Value;
8
9pub async fn get_current_user_playlists(
10 client: &SpotifyApi,
11 limit: Option<u8>,
12 offset: Option<u32>,
13) -> Result<Option<Value>, HttpError> {
14 let limit = limit.unwrap_or(20).min(50);
15 let offset = offset.unwrap_or(0);
16
17 client
18 .get(&Endpoint::CurrentUserPlaylists { limit, offset }.path())
19 .await
20}