feat(api): register cover + stream routes under RequireUser

This commit is contained in:
2026-04-21 22:48:45 -04:00
parent 3656461b20
commit 63d3e234d9
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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)
})
})
+2
View File
@@ -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 {