package playback import ( "context" "errors" "github.com/google/uuid" "github.com/jackc/pgx/v5" "pipu/api/internal/api/gen" "pipu/api/internal/platform/apperr" ) // ReadSocialPlaylist is a projection port for social after live activity authorization. // DTO signing and reactions still use the requesting viewer's principal from ctx. func (h *Handler) ReadSocialPlaylist(ctx context.Context, id uuid.UUID) (gen.Playlist, error) { var owner uuid.UUID e := h.store.pool.QueryRow(ctx, `SELECT user_id FROM playlists WHERE id=$1`, id).Scan(&owner) if errors.Is(e, pgx.ErrNoRows) { return gen.Playlist{}, apperr.NotFound("playlist.not_found", "playlist not found") } if e != nil { return gen.Playlist{}, e } p, e := h.readPlaylist(ctx, owner, id, false) p.ShareId = nil return p, e }