fix to artist unwatch/watch bug
This commit is contained in:
@@ -139,9 +139,13 @@ pub fn artist_page(props: &Props) -> Html {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Watch All
|
// Watch All — prefer enrichment MBID over DB record (import may not have set it)
|
||||||
let artist_name = d.artist.name.clone();
|
let artist_name = d.artist.name.clone();
|
||||||
let artist_mbid = d.artist.musicbrainz_id.clone();
|
let artist_mbid = d
|
||||||
|
.artist_info
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|i| i.mbid.clone())
|
||||||
|
.or_else(|| d.artist.musicbrainz_id.clone());
|
||||||
let message = message.clone();
|
let message = message.clone();
|
||||||
let error = error.clone();
|
let error = error.clone();
|
||||||
let fetch = fetch.clone();
|
let fetch = fetch.clone();
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ pub struct FullArtistDetail {
|
|||||||
pub struct ArtistInfoFe {
|
pub struct ArtistInfoFe {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
pub mbid: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
pub disambiguation: Option<String>,
|
pub disambiguation: Option<String>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub country: Option<String>,
|
pub country: Option<String>,
|
||||||
|
|||||||
@@ -349,6 +349,11 @@ pub async fn enrich_artist(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Backfill artist MBID if the DB record doesn't have one yet (e.g., from import)
|
||||||
|
if artist.musicbrainz_id.is_none() && id.is_some() {
|
||||||
|
let _ = queries::artists::upsert(state.db.conn(), &artist.name, Some(&mbid)).await;
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch artist photo + bio + banner (cached, provider-aware)
|
// Fetch artist photo + bio + banner (cached, provider-aware)
|
||||||
let config = state.config.read().await;
|
let config = state.config.read().await;
|
||||||
let image_source = config.metadata.artist_image_source.clone();
|
let image_source = config.metadata.artist_image_source.clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user