From 5033befa1debe238f33b457771d06f26f51afc6e Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:49:33 -0600 Subject: [PATCH] feat(playlists): Add PlaylistManagerView page - New view for managing playlists with full features - Filter by All/Visible/Hidden - Sort by Name/Recent/Play Count/Custom - Toggle between grid and list view - Drag reorder when in Custom sort mode - Display play count stats - Toggle visibility per playlist - Uses PlaylistCollage for artwork - Persists preferences in localStorage --- .../views/PlaylistManagerView.svelte | 811 ++++++++++++++++++ 1 file changed, 811 insertions(+) create mode 100644 src/lib/components/views/PlaylistManagerView.svelte diff --git a/src/lib/components/views/PlaylistManagerView.svelte b/src/lib/components/views/PlaylistManagerView.svelte new file mode 100644 index 000000000..609b77691 --- /dev/null +++ b/src/lib/components/views/PlaylistManagerView.svelte @@ -0,0 +1,811 @@ + + +
+ +
+ +

Playlist Manager

+
+ + +
+ + + + + + + + + + {displayPlaylists.length} playlists +
+ + {#if sort === 'custom'} +

Drag playlists to reorder them

+ {/if} + + + {#if loading} +
+
+

Loading playlists...

+
+ {:else if displayPlaylists.length === 0} +
+

{filter === 'hidden' ? 'No hidden playlists' : filter === 'visible' ? 'No visible playlists' : 'No playlists yet'}

+
+ {:else if viewMode === 'grid'} + +
+ {#each displayPlaylists as playlist (playlist.id)} + {@const isHidden = playlistSettings.get(playlist.id)?.hidden} + {@const stats = playlistStats.get(playlist.id)} +
handleDragStart(e, playlist.id)} + ondragover={(e) => handleDragOver(e, playlist.id)} + ondragleave={handleDragLeave} + ondrop={(e) => handleDrop(e, playlist.id)} + ondragend={handleDragEnd} + role="button" + tabindex="0" + onclick={() => onPlaylistSelect?.(playlist.id)} + > + {#if sort === 'custom'} +
+ +
+ {/if} +
+ + {#if isHidden} +
+ +
+ {/if} +
+
+ {playlist.name} + {playlist.tracks_count} tracks + {#if stats && stats.play_count > 0} + + + {stats.play_count} plays + + {/if} +
+
+ +
+
+ {/each} +
+ {:else} + +
+ {#each displayPlaylists as playlist (playlist.id)} + {@const isHidden = playlistSettings.get(playlist.id)?.hidden} + {@const stats = playlistStats.get(playlist.id)} +
handleDragStart(e, playlist.id)} + ondragover={(e) => handleDragOver(e, playlist.id)} + ondragleave={handleDragLeave} + ondrop={(e) => handleDrop(e, playlist.id)} + ondragend={handleDragEnd} + role="button" + tabindex="0" + onclick={() => onPlaylistSelect?.(playlist.id)} + > + {#if sort === 'custom'} +
+ +
+ {/if} +
+ +
+
+ {playlist.name} + + {playlist.tracks_count} tracks + {#if playlist.duration > 0} + . + {formatDuration(playlist.duration)} + {/if} + +
+ {#if stats && stats.play_count > 0} + + + {stats.play_count} + + {/if} + {#if isHidden} + + + + {/if} +
+ +
+
+ {/each} +
+ {/if} +
+ + +{#if editingPlaylist} + { editModalOpen = false; editingPlaylist = null; }} + onSuccess={handleEditSuccess} + onDelete={handleDelete} + /> +{/if} + +