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} > - +