Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f5d3f597a |
+14
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user