Skip to content

Commit 1647d6b

Browse files
author
Walle
committed
fix: live detail response structure - data is flat not nested, use live_name field
1 parent fb69d74 commit 1647d6b

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

cmd/kb/kb.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,19 +385,17 @@ func newLiveCmd() *cobra.Command {
385385
enc.SetIndent("", " ")
386386
return enc.Encode(resp)
387387
}
388-
d := resp.Data.Live
388+
d := resp.Data
389389
table := tablewriter.NewWriter(cmd.OutOrStdout())
390390
table.SetHeader([]string{"Field", "Value"})
391391
table.SetBorder(false)
392392
table.SetAutoWrapText(false)
393-
table.Append([]string{"ID", d.LiveID})
394393
table.Append([]string{"Name", d.Name})
395-
table.Append([]string{"Status", d.Status})
396394
if d.PostSummary != "" {
397395
table.Append([]string{"Summary", ui.Truncate(d.PostSummary, 200)})
398396
}
399397
if d.PostMediaText != "" {
400-
table.Append([]string{"Transcript", ui.Truncate(d.PostMediaText, 300)})
398+
table.Append([]string{"Transcript", ui.Truncate(d.PostMediaText, 500)})
401399
}
402400
table.Render()
403401
return nil

internal/client/client.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -561,23 +561,18 @@ func (c *Client) KBLiveList(topicID string, page int) (*KBLiveListResponse, erro
561561
}
562562

563563
// KBLiveDetail represents the full detail of a live session.
564+
// The API returns fields directly in data, not nested under a "live" key.
564565
type KBLiveDetail struct {
565566
LiveID string `json:"live_id"`
566-
Name string `json:"name"`
567+
Name string `json:"live_name"`
567568
PostSummary string `json:"post_summary"`
568569
PostMediaText string `json:"post_media_text"`
569-
Status string `json:"status"`
570-
}
571-
572-
// KBLiveDetailData is the data field of the live detail response.
573-
type KBLiveDetailData struct {
574-
Live KBLiveDetail `json:"live"`
575570
}
576571

577572
// KBLiveDetailResponse is the response from the live detail endpoint.
578573
type KBLiveDetailResponse struct {
579-
Success bool `json:"success"`
580-
Data KBLiveDetailData `json:"data"`
574+
Success bool `json:"success"`
575+
Data KBLiveDetail `json:"data"`
581576
}
582577

583578
// KBLiveGet fetches full detail of a live session including summary and transcript.

0 commit comments

Comments
 (0)