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

Method update_artist

src-tauri/database/src/database.rs:1048–1073  ·  view source on GitHub ↗
(&self, mut artist: QueryableArtist)

Source from the content-addressed store, hash-verified

1046
1047 #[tracing::instrument(level = "debug", skip(self))]
1048 pub fn update_artist(&self, mut artist: QueryableArtist) -> Result<()> {
1049 trace!("Updating artist");
1050 let mut conn = self.pool.get().unwrap();
1051
1052 let existing_artist_info = self
1053 .get_artists(
1054 QueryableArtist {
1055 artist_id: artist.artist_id.clone(),
1056 ..Default::default()
1057 },
1058 false,
1059 &mut conn,
1060 )?
1061 .first()
1062 .and_then(|a| a.artist_extra_info.clone());
1063
1064 artist.artist_extra_info =
1065 self.merge_extra_info(existing_artist_info, artist.artist_extra_info);
1066
1067 update(artists)
1068 .filter(schema::artists::artist_id.eq(artist.artist_id.clone()))
1069 .set(artist)
1070 .execute(&mut conn)?;
1071 info!("Updated artist");
1072 Ok(())
1073 }
1074
1075 #[tracing::instrument(level = "debug", skip(self))]
1076 pub fn update_playlist(&self, playlist: QueryablePlaylist) -> Result<()> {

Callers 2

test_artist_operationsFunction · 0.80
update_songsMethod · 0.80

Calls 6

getMethod · 0.80
get_artistsMethod · 0.80
cloneMethod · 0.80
merge_extra_infoMethod · 0.80
setMethod · 0.80
eqMethod · 0.45

Tested by 1

test_artist_operationsFunction · 0.64