From 797bed8e7d137d35f7b33f23311536770010f84f Mon Sep 17 00:00:00 2001 From: XShine555 Date: Fri, 25 Sep 2026 01:11:01 +0200 Subject: [PATCH] Split the library page into song, album and upload routes with linked tabs --- web-player/docs/paginas.md | 8 +- .../music/library/LibraryAlbumsSection.svelte | 55 ------- .../music/library/LibraryTracksSection.svelte | 2 +- .../music/library/UploadSettings.svelte | 2 +- .../lib/components/shell/MobileHeader.svelte | 2 +- .../ui/media/MediaCreateCard.svelte | 11 +- .../lib/components/ui/primitives/Tabs.svelte | 29 ++++ web-player/src/lib/server/albums.ts | 133 +++++++++++++++++ web-player/src/lib/state/history.svelte.ts | 2 + .../src/routes/(app)/library/+layout.svelte | 51 +++++++ .../src/routes/(app)/library/+page.server.ts | 141 +----------------- .../src/routes/(app)/library/+page.svelte | 80 +--------- .../(app)/library/albums/+page.server.ts | 10 ++ .../routes/(app)/library/albums/+page.svelte | 22 +++ .../(app)/library/albums/[id]/+page.server.ts | 19 +++ .../(app)/library/albums/[id]/+page.svelte | 18 +++ .../(app)/library/albums/new/+page.server.ts | 12 ++ .../(app)/library/albums/new/+page.svelte | 16 ++ .../(app)/library/uploads/+page.server.ts | 10 ++ .../routes/(app)/library/uploads/+page.svelte | 7 + 20 files changed, 351 insertions(+), 279 deletions(-) delete mode 100644 web-player/src/lib/components/music/library/LibraryAlbumsSection.svelte create mode 100644 web-player/src/lib/components/ui/primitives/Tabs.svelte create mode 100644 web-player/src/lib/server/albums.ts create mode 100644 web-player/src/routes/(app)/library/+layout.svelte create mode 100644 web-player/src/routes/(app)/library/albums/+page.server.ts create mode 100644 web-player/src/routes/(app)/library/albums/+page.svelte create mode 100644 web-player/src/routes/(app)/library/albums/[id]/+page.server.ts create mode 100644 web-player/src/routes/(app)/library/albums/[id]/+page.svelte create mode 100644 web-player/src/routes/(app)/library/albums/new/+page.server.ts create mode 100644 web-player/src/routes/(app)/library/albums/new/+page.svelte create mode 100644 web-player/src/routes/(app)/library/uploads/+page.server.ts create mode 100644 web-player/src/routes/(app)/library/uploads/+page.svelte diff --git a/web-player/docs/paginas.md b/web-player/docs/paginas.md index 7c421d4..737aeae 100644 --- a/web-player/docs/paginas.md +++ b/web-player/docs/paginas.md @@ -12,7 +12,11 @@ src/routes/ +page.svelte / Home explore/ /explore Search and genre discovery liked/ /liked Liked songs - library/ /library Your uploaded songs + library/ /library Manage music: your songs + albums/ /library/albums Your albums (grid) + new/ /library/albums/new Create an album + [id]/ /library/albums/:id Edit an album + uploads/ /library/uploads Upload queue upload/ /upload Upload a song albums/ /albums Your albums [id]/ /albums/:id Album detail @@ -32,7 +36,7 @@ Global chrome on every app page: sidebar (desktop) or tab bar (mobile), top bar - **Home `/`**: a greeting, weekly listening stats, "continue listening" (recently played merged with the in-session history), the featured playlist with its first tracks (play and shuffle load the full list on demand), the user's mixes and playlists. Anonymous visitors are redirected to `/explore`. - **Explore `/explore`**: genre tiles when there is no query, otherwise search results grouped by songs, albums, users and playlists with filter chips and counts taken from the API totals. Songs paginate with infinite scroll. Track and album context menus offer play next, add to queue and add to playlist. - **Liked `/liked`**: the songs the user liked, newest first, with unlike per row. -- **Library `/library`**: the songs the user uploaded, with a confirmed delete. +- **Library `/library`, `/library/albums`, `/library/uploads`**: the manage-music area, one route per section behind shared tabs. Songs lists the user's uploads with a confirmed delete; Albums lists the user's albums and edits them at `/library/albums/new` and `/library/albums/:id`; Uploads is the upload queue. - **Upload `/upload`**: audio, cover, title, genres (incompatible genres are blocked) and explicit flag. The server reserves presigned URLs, uploads both files and creates the track; processing happens asynchronously in the backend. - **Albums `/albums`, `/albums/:id`**: list and create albums. The owner can edit, delete and add or remove tracks from their library. - **Playlists `/playlists`, `/playlists/:id`**: list and create playlists. The owner can edit, delete and remove tracks; everyone else gets a read only view. diff --git a/web-player/src/lib/components/music/library/LibraryAlbumsSection.svelte b/web-player/src/lib/components/music/library/LibraryAlbumsSection.svelte deleted file mode 100644 index bcfedec..0000000 --- a/web-player/src/lib/components/music/library/LibraryAlbumsSection.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - -{#if editing} -
- {#key editing.album?.id} - (editing = null)} - /> - {/key} -
-{:else} -
- (editing = { album: null })} - /> - {#each albums as album, i (album.id)} - { - event.preventDefault(); - editing = { album }; - }} - /> - {/each} -
-{/if} diff --git a/web-player/src/lib/components/music/library/LibraryTracksSection.svelte b/web-player/src/lib/components/music/library/LibraryTracksSection.svelte index 336b83d..ff1ee0a 100644 --- a/web-player/src/lib/components/music/library/LibraryTracksSection.svelte +++ b/web-player/src/lib/components/music/library/LibraryTracksSection.svelte @@ -105,7 +105,7 @@ description="Sube la primera y aparecerá aquí lista para reproducir." > {#snippet actions()} - diff --git a/web-player/src/lib/components/music/library/UploadSettings.svelte b/web-player/src/lib/components/music/library/UploadSettings.svelte index 180422f..dfefef3 100644 --- a/web-player/src/lib/components/music/library/UploadSettings.svelte +++ b/web-player/src/lib/components/music/library/UploadSettings.svelte @@ -73,7 +73,7 @@