From 2b286a9bfd9aad65faa1b60b6728aa9196148155 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 4 May 2026 10:31:09 -0400 Subject: [PATCH] docs(db/m7-352): note ListPlaylistsByUserAndKind is test-only Production list-playlists handler reuses Service.List + in-memory kind filter so other users' public playlists can surface alongside the caller's filtered own. Comment clarifies the divergence so future readers don't expect this query to be wired into the API path. --- internal/db/queries/system_playlists.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/db/queries/system_playlists.sql b/internal/db/queries/system_playlists.sql index 4f77875b..63580593 100644 --- a/internal/db/queries/system_playlists.sql +++ b/internal/db/queries/system_playlists.sql @@ -132,7 +132,11 @@ SELECT a.cover_art_path DELETE FROM playlists WHERE user_id = $1 AND kind = 'system'; -- name: ListPlaylistsByUserAndKind :many --- Powers GET /api/me/playlists?kind=. Sorted by updated_at DESC. +-- Used in integration tests; production filter applied in Go +-- (api.handleListPlaylists fetches via Service.List and filters by Kind in +-- memory so it can also surface other users' public playlists alongside +-- the caller's own kind-filtered ones). +-- Sorted by updated_at DESC. SELECT id, user_id, name, description, is_public, kind, system_variant, seed_artist_id, cover_path, track_count, duration_sec, created_at, updated_at