A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

Optimize feed handler by using subscription count query

+3 -3
+3 -3
internal/server/feeds_handler.go
··· 30 30 subs = subs[:page.PageSize] 31 31 } 32 32 33 - allSubs, err := s.dbs.Articles.ListSubscriptions(ctx, user.DID, "", 1000, 0) 33 + subCount, err := s.dbs.Articles.GetSubscriptionCount(ctx, user.DID) 34 34 if err != nil { 35 - s.logger.Warn("failed to list all subscriptions", "error", err, "did", user.DID) 35 + s.logger.Warn("failed to get subscription count", "error", err, "did", user.DID) 36 36 } 37 37 38 38 feedRecs, err := s.engine.GetFeedRecommendations(ctx, user.DID, 6) ··· 69 69 s.render(w, r, "feeds.html", map[string]any{ 70 70 "User": user, 71 71 "Subscriptions": subs, 72 - "SubscriptionCount": len(allSubs), 72 + "SubscriptionCount": subCount, 73 73 "Categories": categories, 74 74 "Category": category, 75 75 "FeedRecommendations": feedRecs,