feat: daily vani
This commit is contained in:
@@ -87,7 +87,7 @@ func (s *VaniService) choose(ctx context.Context, exclude map[string][]string, d
|
||||
}
|
||||
case "prose":
|
||||
if p, err := s.repo.SampleProse(ctx, exclude["prose"]); err == nil && p != nil {
|
||||
return prosePick(p, day)
|
||||
return prosePick(p, s.repo.BookTitle(ctx, p.Book), day)
|
||||
}
|
||||
case "transcript":
|
||||
if t, err := s.repo.SampleTranscript(ctx, exclude["transcript"]); err == nil && t != nil {
|
||||
@@ -120,7 +120,7 @@ func versePick(v *repository.VerseDoc, day time.Time) *model.VaniPick {
|
||||
}
|
||||
}
|
||||
|
||||
func prosePick(p *repository.ProseChapterDoc, day time.Time) *model.VaniPick {
|
||||
func prosePick(p *repository.ProseChapterDoc, bookTitle string, day time.Time) *model.VaniPick {
|
||||
first := ""
|
||||
if len(p.Paragraphs) > 0 {
|
||||
first = p.Paragraphs[0]
|
||||
@@ -130,11 +130,12 @@ func prosePick(p *repository.ProseChapterDoc, day time.Time) *model.VaniPick {
|
||||
Kind: "prose",
|
||||
RefID: "prose:" + p.ID.Hex(),
|
||||
Payload: model.VaniPayload{
|
||||
Kind: "prose",
|
||||
Label: "Chapter",
|
||||
Title: p.Title,
|
||||
Subtitle: excerpt(first, 140),
|
||||
Href: proseURL(p.Book, p.Volume, p.Type, p.Slug),
|
||||
Kind: "prose",
|
||||
Label: "Chapter",
|
||||
Title: p.Title,
|
||||
Subtitle: excerpt(first, 140),
|
||||
Href: proseURL(p.Book, p.Volume, p.Type, p.Slug),
|
||||
BookTitle: bookTitle,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user