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

Function create_playlist

src/utils/db_utils.rs:340–357  ·  view source on GitHub ↗
(playlist: QueryablePlaylist, songs: Option<Vec<Song>>)

Source from the content-addressed store, hash-verified

338
339#[tracing::instrument(level = "debug", skip(playlist))]
340pub fn create_playlist(playlist: QueryablePlaylist, songs: Option<Vec<Song>>) {
341 spawn_local(async move {
342 let res = super::invoke::create_playlist(playlist).await;
343 match res {
344 Err(res) => {
345 tracing::error!("Failed to create playlist: {:?}", res);
346 }
347 Ok(playlist_id) => {
348 if let Some(songs) = songs {
349 let res = super::invoke::add_to_playlist(playlist_id, songs).await;
350 if let Err(e) = res {
351 tracing::error!("Failed to add songs to playlist: {:?}", e);
352 }
353 }
354 }
355 }
356 });
357}
358
359#[tracing::instrument(level = "debug", skip(playlist, refresh_cb))]
360pub fn remove_playlist(playlist: QueryablePlaylist, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>) {

Callers 3

ControlsFunction · 0.85
NewPlaylistModalFunction · 0.85
add_to_libraryMethod · 0.85

Calls 1

add_to_playlistFunction · 0.85

Tested by

no test coverage detected