add image fallback to library artists
This commit is contained in:
parent
8e89040b19
commit
8f9851c50f
1 changed files with 9 additions and 3 deletions
|
|
@ -26081,9 +26081,15 @@ function updateArtistHeroSection(artist, discography) {
|
|||
|
||||
imageElement.onerror = () => {
|
||||
console.error(`❌ Failed to load artist image: ${artist.image_url}`);
|
||||
imageElement.style.display = "none";
|
||||
if (fallbackElement) {
|
||||
fallbackElement.style.display = "flex";
|
||||
// Try Deezer fallback before emoji
|
||||
if (artist.deezer_id && !imageElement.dataset.triedDeezer) {
|
||||
imageElement.dataset.triedDeezer = 'true';
|
||||
imageElement.src = `https://api.deezer.com/artist/${artist.deezer_id}/image?size=big`;
|
||||
} else {
|
||||
imageElement.style.display = "none";
|
||||
if (fallbackElement) {
|
||||
fallbackElement.style.display = "flex";
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue