Update to artist credit handling

This commit is contained in:
Connor Johnstone
2026-03-18 14:34:44 -04:00
parent 966dc6ca86
commit 4400cbc1cb
4 changed files with 42 additions and 11 deletions

View File

@@ -105,7 +105,7 @@ pub async fn tag_track(
(details, best_release)
};
// Upsert artist with MusicBrainz ID
// Upsert primary artist with MusicBrainz ID
let artist_id = match &details.artist_mbid {
Some(mbid) => {
Some(queries::artists::upsert(conn, &details.artist, Some(mbid)).await?.id)
@@ -115,6 +115,13 @@ pub async fn tag_track(
}
};
// Upsert secondary collaborator artists so they exist as separate library entries
for (name, mbid) in &details.secondary_artists {
if let Err(e) = queries::artists::upsert(conn, name, Some(mbid)).await {
tracing::warn!(artist = %name, error = %e, "failed to upsert secondary artist");
}
}
// Upsert album from best release
let (album_id, album_name) = if let Some(ref release) = best_release {
let album = queries::albums::upsert(