From 63d3e234d924303fb43df36bb8dd6edd0ba21f12 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 21 Apr 2026 22:48:45 -0400 Subject: [PATCH] feat(api): register cover + stream routes under RequireUser --- internal/api/api.go | 2 ++ internal/api/library_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/api/api.go b/internal/api/api.go index 94d36b06..2e0c6eb9 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -28,7 +28,9 @@ func Mount(r chi.Router, pool *pgxpool.Pool, logger *slog.Logger) { authed.Get("/artists", h.handleListArtists) authed.Get("/artists/{id}", h.handleGetArtist) authed.Get("/albums/{id}", h.handleGetAlbum) + authed.Get("/albums/{id}/cover", h.handleGetCover) authed.Get("/tracks/{id}", h.handleGetTrack) + authed.Get("/tracks/{id}/stream", h.handleGetStream) authed.Get("/search", h.handleSearch) }) }) diff --git a/internal/api/library_test.go b/internal/api/library_test.go index 21a8a9b0..d0aff688 100644 --- a/internal/api/library_test.go +++ b/internal/api/library_test.go @@ -439,7 +439,9 @@ func TestRoutesRegisteredInMount(t *testing.T) { "/api/artists", "/api/artists/00000000-0000-0000-0000-000000000001", "/api/albums/00000000-0000-0000-0000-000000000001", + "/api/albums/00000000-0000-0000-0000-000000000001/cover", "/api/tracks/00000000-0000-0000-0000-000000000001", + "/api/tracks/00000000-0000-0000-0000-000000000001/stream", "/api/search?q=x", } for _, p := range paths {