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