Compare commits

...

1 Commits

Author SHA1 Message Date
Connor Johnstone 0f5d3f597a still getting extra artists. need to test on my deployment 2026-03-31 12:32:32 -04:00
+14 -17
View File
@@ -94,23 +94,20 @@ pub async fn tag_track(
);
}
// Use existing artist_id if already set (e.g., from download pipeline).
// Only upsert from MB when the track has no artist association yet.
let artist_id = if track.artist_id.is_some() {
track.artist_id
} else {
match &details.artist_mbid {
Some(mbid) => Some(
queries::artists::upsert(conn, &details.artist, Some(mbid))
.await?
.id,
),
None => Some(
queries::artists::upsert(conn, &details.artist, None)
.await?
.id,
),
}
// Always resolve artist_id from MB data — this is the authoritative source for the
// primary artist. The indexer or download worker may have set artist_id to a collaborator
// artist (e.g., "Bass Drum of Death, Not Documented"), so we always correct it here.
let artist_id = match &details.artist_mbid {
Some(mbid) => Some(
queries::artists::upsert(conn, &details.artist, Some(mbid))
.await?
.id,
),
None => Some(
queries::artists::upsert(conn, &details.artist, None)
.await?
.id,
),
};
// Upsert album from best release