Update to artist credit handling
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user