(songs: Vec<Song>, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>)
| 310 | |
| 311 | #[tracing::instrument(level = "debug", skip(songs, refresh_cb))] |
| 312 | pub fn remove_songs_from_library(songs: Vec<Song>, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>) { |
| 313 | spawn_local(async move { |
| 314 | let res = super::invoke::remove_songs( |
| 315 | songs |
| 316 | .iter() |
| 317 | .map(|s| s.song._id.clone().unwrap_or_default()) |
| 318 | .collect(), |
| 319 | ) |
| 320 | .await; |
| 321 | if res.is_err() { |
| 322 | tracing::error!("Error removing songs: {:?}", res); |
| 323 | } else { |
| 324 | refresh_cb.as_ref()(); |
| 325 | } |
| 326 | }); |
| 327 | } |
| 328 | |
| 329 | #[tracing::instrument(level = "debug", skip(id, songs))] |
| 330 | pub fn add_to_playlist(id: String, songs: Vec<Song>) { |
no test coverage detected