(playlist: QueryablePlaylist, songs: Option<Vec<Song>>)
| 338 | |
| 339 | #[tracing::instrument(level = "debug", skip(playlist))] |
| 340 | pub 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))] |
| 360 | pub fn remove_playlist(playlist: QueryablePlaylist, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>) { |
no test coverage detected