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

Method update_songs

src-tauri/database/src/database.rs:1088–1109  ·  view source on GitHub ↗
(&self, songs: Vec<Song>)

Source from the content-addressed store, hash-verified

1086
1087 #[tracing::instrument(level = "debug", skip(self))]
1088 pub fn update_songs(&self, songs: Vec<Song>) -> Result<()> {
1089 trace!("Updating songs");
1090 let mut conn = self.pool.get().unwrap();
1091
1092 for song in songs {
1093 if let Some(album) = song.album {
1094 self.update_album(album)?;
1095 }
1096
1097 if let Some(artist) = song.artists {
1098 for a in artist {
1099 self.update_artist(a)?;
1100 }
1101 }
1102 update(allsongs)
1103 .filter(schema::allsongs::_id.eq(song.song._id.clone()))
1104 .set(song.song)
1105 .execute(&mut conn)?;
1106 }
1107 info!("Updated songs");
1108 Ok(())
1109 }
1110
1111 #[tracing::instrument(level = "debug", skip(self))]
1112 pub fn update_lyrics(&self, id: String, lyrics: String) -> Result<()> {

Callers 1

update_songMethod · 0.80

Calls 6

getMethod · 0.80
update_albumMethod · 0.80
update_artistMethod · 0.80
setMethod · 0.80
cloneMethod · 0.80
eqMethod · 0.45

Tested by

no test coverage detected