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

Function remove_songs_from_library

src/utils/db_utils.rs:312–327  ·  view source on GitHub ↗
(songs: Vec<Song>, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>)

Source from the content-addressed store, hash-verified

310
311#[tracing::instrument(level = "debug", skip(songs, refresh_cb))]
312pub 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))]
330pub fn add_to_playlist(id: String, songs: Vec<Song>) {

Callers 1

remove_from_libraryMethod · 0.85

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected