MCPcopy Create free account
hub / github.com/Moosync/Moosync / fetch_user_playlists

Method fetch_user_playlists

src-tauri/src/providers/spotify.rs:554–574  ·  view source on GitHub ↗
(
        &self,
        pagination: Pagination,
    )

Source from the content-addressed store, hash-verified

552
553 #[tracing::instrument(level = "debug", skip(self, pagination))]
554 async fn fetch_user_playlists(
555 &self,
556 pagination: Pagination,
557 ) -> Result<(Vec<QueryablePlaylist>, Pagination)> {
558 let mut ret = vec![];
559 if let Some(api_client) = self.get_api_client().await.as_ref() {
560 let playlists = api_client
561 .api_client
562 .current_user_playlists_manual(Some(pagination.limit), Some(pagination.offset))
563 .await;
564 if let Ok(playlists) = playlists {
565 for playlist in playlists.items {
566 ret.push(self.parse_playlist(playlist))
567 }
568 }
569 tracing::info!("Got user playlists {:?}", ret);
570 return Ok((ret, pagination.next_page()));
571 }
572
573 Err("API client not initialized".into())
574 }
575
576 #[tracing::instrument(level = "debug", skip(self, playlist, pagination))]
577 async fn get_playlist_content(

Callers

nothing calls this directly

Calls 3

next_pageMethod · 0.80
get_api_clientMethod · 0.45
parse_playlistMethod · 0.45

Tested by

no test coverage detected