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} > - +
{#if sort === 'custom' && !isUnavailable}
- {:else} -
{/if} +
+ + +
onPlaylistSelect?.(playlist.id)} + title={isUnavailable ? $t('offline.viewOnly') : undefined} + > +
+ + {#if localStatus === 'all_local'} +
+ +
+ {:else if localStatus === 'some_local'} +
+ +
+ {/if} +
+
+ {playlist.name} + {getTotalTrackCount(playlist)} tracks{#if getLocalTrackCount(playlist.id) > 0} ({getLocalTrackCount(playlist.id)} local){/if} +
+
+ + + @@ -707,12 +720,15 @@ {stats.play_count} {/if} - {#if isFavorite} - - - - {/if} {#if !isUnavailable} +