blog style improvements; fix connection pool drain

This commit is contained in:
ari melody 2025-11-08 18:42:02 +00:00
parent 0a75216aaf
commit 1d98a6fdca
Signed by: ari
GPG key ID: CF99829C92678188
8 changed files with 51 additions and 24 deletions

View file

@ -141,11 +141,17 @@ func ServeBlogPost(app *model.AppState, blogPostID string) http.Handler {
var blueskyURL string
var blueskyPost *model.ThreadViewPost
if blog.Bluesky != nil {
blueskyPost, err = controller.FetchThreadViewPost(blog.Bluesky.ActorDID, blog.Bluesky.RecordID)
blueskyPost, err = controller.FetchThreadViewPost(app, blog.Bluesky.ActorDID, blog.Bluesky.RecordID)
if err != nil {
fmt.Fprintf(os.Stderr, "WARN: Failed to fetch blog post Bluesky thread: %v\n", err)
} else {
comments = append(comments, blueskyPost.Replies...)
replies := []*model.ThreadViewPost{}
for _, reply := range blueskyPost.Replies {
if reply.Post.Author.DID != blog.Bluesky.ActorDID {
replies = append(replies, reply)
}
}
comments = append(comments, replies...)
likeCount += blueskyPost.Post.LikeCount
boostCount += blueskyPost.Post.RepostCount
blueskyURL = fmt.Sprintf("https://bsky.app/profile/%s/post/%s", blueskyPost.Post.Author.Handle, blog.Bluesky.RecordID)