From 07431f875912e7e2f36488901b7a5f5fe926b3e1 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 24 Jan 2026 17:36:34 -0600 Subject: [PATCH] Add favorite toggle button to PlaylistManager grid and list views - Add toggleFavorite function for playlist favorites - Grid view: Move action buttons to footer for even margins - Grid view: Remove favorite badge and hidden badge from artwork - List view: Add favorite toggle to left of visibility button - Remove unused CSS for hidden-badge, favorite-badge, favorite-indicator --- .../views/PlaylistManagerView.svelte | 177 ++++++++++-------- 1 file changed, 98 insertions(+), 79 deletions(-) diff --git a/src/lib/components/views/PlaylistManagerView.svelte b/src/lib/components/views/PlaylistManagerView.svelte index 6a6338fd7..d3ce0341c 100644 --- a/src/lib/components/views/PlaylistManagerView.svelte +++ b/src/lib/components/views/PlaylistManagerView.svelte @@ -356,6 +356,19 @@ } } + async function toggleFavorite(playlist: Playlist) { + const current = playlistSettings.get(playlist.id); + const newFavorite = !current?.is_favorite; + try { + await invoke('playlist_set_favorite', { playlistId: playlist.id, favorite: newFavorite }); + const updated = new Map(playlistSettings); + updated.set(playlist.id, { ...current, qobuz_playlist_id: playlist.id, is_favorite: newFavorite, hidden: current?.hidden ?? false, position: current?.position ?? 0 }); + playlistSettings = updated; + } catch (err) { + console.error('Failed to toggle favorite:', err); + } + } + // Drag and drop handlers function handleDragStart(e: DragEvent, playlistId: number) { if (sort !== 'custom') return; @@ -568,17 +581,53 @@ ondrop={(e) => !isUnavailable && handleDrop(e, playlist.id)} ondragend={handleDragEnd} > - +