From 1cdf15ecf062542b26763577e90495685b6c63e1 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 25 Jan 2026 20:17:14 -0600 Subject: [PATCH] feat(settings): add MusicBrainz cache clear button in Storage section cc --- src/lib/components/views/SettingsView.svelte | 31 +++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 1467fd0e5..fdeeee6a2 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -106,6 +106,7 @@ // Lyrics cache state let isClearingLyrics = $state(false); let lyricsCacheStats = $state<{ entries: number; sizeBytes: number } | null>(null); + let isClearingMusicBrainz = $state(false); // Migration state let showMigrationModal = $state(false); @@ -1492,6 +1493,19 @@ } } + async function handleClearMusicBrainzCache() { + if (isClearingMusicBrainz) return; + isClearingMusicBrainz = true; + try { + await invoke('musicbrainz_clear_cache'); + console.log('MusicBrainz cache cleared'); + } catch (err) { + console.error('Failed to clear MusicBrainz cache:', err); + } finally { + isClearingMusicBrainz = false; + } + } + function formatBytes(bytes: number): string { if (bytes === 0) return '0 B'; const k = 1024; @@ -2162,7 +2176,7 @@ {isClearing ? $t('settings.storage.clearing') : $t('actions.clear')} -
+
{$t('settings.lyrics.clearLyrics')} @@ -2186,6 +2200,21 @@ {isClearingLyrics ? $t('settings.storage.clearing') : $t('actions.clear')}
+
+
+ MusicBrainz Cache + + Artist relationships, metadata enrichment + +
+ +