Post reactions and replies counting

🎨 Improve the styles of post service
This commit is contained in:
2025-06-20 00:31:16 +08:00
parent abc89dc782
commit 27276c66c5
4 changed files with 68 additions and 28 deletions

View File

@ -24,8 +24,7 @@ public class ActivityService(AppDatabase db, PublisherService pub, RelationshipS
.FilterWithVisibility(null, [], [], isListing: true)
.Take(take)
.ToListAsync();
posts = PostService.TruncatePostContent(posts);
posts = await ps.LoadPublishers(posts);
posts = await ps.LoadPostInfo(posts, null, true);
var postsId = posts.Select(e => e.Id).ToList();
var reactionMaps = await ps.GetPostReactionMapBatch(postsId);
@ -63,8 +62,7 @@ public class ActivityService(AppDatabase db, PublisherService pub, RelationshipS
.FilterWithVisibility(currentUser, userFriends, userPublishers, isListing: true)
.Take(take)
.ToListAsync();
posts = PostService.TruncatePostContent(posts);
posts = await ps.LoadPublishers(posts);
posts = await ps.LoadPostInfo(posts, currentUser, true);
var postsId = posts.Select(e => e.Id).ToList();
var reactionMaps = await ps.GetPostReactionMapBatch(postsId);