From f92db3d6755ff3706c05a58cdff9eee55cc76be2 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 25 Jan 2026 21:48:42 -0600 Subject: [PATCH] feat: hide MusicBrainz Relationships section when disabled or unavailable - Add mbAvailable state to track MusicBrainz availability - Set mbAvailable=false when MB is disabled or API fails - Wrap entire Relationships section with {#if mbAvailable} --- .../components/views/ArtistDetailView.svelte | 132 +++++++++--------- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/src/lib/components/views/ArtistDetailView.svelte b/src/lib/components/views/ArtistDetailView.svelte index ae1385dce..2acdba1c9 100644 --- a/src/lib/components/views/ArtistDetailView.svelte +++ b/src/lib/components/views/ArtistDetailView.svelte @@ -160,6 +160,7 @@ let mbRelationships = $state(null); let mbRelationshipsLoading = $state(false); let mbArtistMbid = $state(null); + let mbAvailable = $state(true); // Assume available until proven otherwise let artistDetailEl = $state(null); let aboutSection = $state(null); let topTracksSection = $state(null); @@ -503,11 +504,13 @@ mbRelationshipsLoading = true; mbRelationships = null; mbArtistMbid = null; + mbAvailable = true; // Reset on each load attempt try { // Check if MusicBrainz is enabled const enabled = await invoke('musicbrainz_is_enabled'); if (!enabled) { + mbAvailable = false; mbRelationshipsLoading = false; return; } @@ -542,6 +545,7 @@ }; } catch (err) { console.error('Failed to load MusicBrainz relationships:', err); + mbAvailable = false; mbRelationships = null; } finally { mbRelationshipsLoading = false; @@ -1972,70 +1976,72 @@ - - + {/if} {/if}