From fa3d2b932cdb6559c1de573064d5da88b9eead82 Mon Sep 17 00:00:00 2001 From: Krispire Admin Date: Sat, 11 Jul 2026 00:57:27 +0530 Subject: [PATCH] feat: daily vani --- internal/model/vani.go | 1 + internal/service/vani_service.go | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/internal/model/vani.go b/internal/model/vani.go index dea1a97..e6bebdd 100644 --- a/internal/model/vani.go +++ b/internal/model/vani.go @@ -12,6 +12,7 @@ type VaniPayload struct { Subtitle string `json:"subtitle"` // short excerpt or date · place Href string `json:"href"` // in-app path to open the item BookTitle string `json:"book_title,omitempty"` // e.g. "Bhagavad-gītā As It Is" + Date string `json:"date,omitempty"` // transcript date, for the "Lecture • DATE" line } // VaniPick is one persisted day's choice. RefID is `:` and diff --git a/internal/service/vani_service.go b/internal/service/vani_service.go index bd44242..1c38317 100644 --- a/internal/service/vani_service.go +++ b/internal/service/vani_service.go @@ -145,28 +145,20 @@ func transcriptPick(t *repository.TranscriptionDoc, day time.Time) *model.VaniPi if t.Type == "conversation" { label = "Conversation" } - // Prefer a date · place line; fall back to the first spoken line. - var bits []string - if t.Date != nil && *t.Date != "" { - bits = append(bits, *t.Date) - } - if t.Place != nil && *t.Place != "" { - bits = append(bits, *t.Place) - } - subtitle := strings.Join(bits, " · ") - if subtitle == "" && len(t.Content) > 0 { - subtitle = excerpt(t.Content[0].Text, 140) + date := "" + if t.Date != nil { + date = *t.Date } return &model.VaniPick{ Day: day, Kind: "transcript", RefID: "transcript:" + t.ID.Hex(), Payload: model.VaniPayload{ - Kind: "transcript", - Label: label, - Title: t.Name, - Subtitle: subtitle, - Href: "/transcriptions/" + t.Slug, + Kind: "transcript", + Label: label, + Title: t.Name, + Href: "/transcriptions/" + t.Slug, + Date: date, }, } }