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

Function add_songs_to_library

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

Source from the content-addressed store, hash-verified

298
299#[tracing::instrument(level = "debug", skip(songs, refresh_cb))]
300pub fn add_songs_to_library(songs: Vec<Song>, refresh_cb: Arc<Box<dyn Fn() + Send + Sync>>) {
301 spawn_local(async move {
302 let res = super::invoke::insert_songs(songs).await;
303 if res.is_err() {
304 tracing::error!("Error adding songs: {:?}", res);
305 } else {
306 refresh_cb.as_ref()();
307 }
308 });
309}
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>>) {

Callers 2

SongFromUrlModalFunction · 0.85
add_to_libraryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected