diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs
index 87ba8a0..cc3133c 100644
--- a/DysonNetwork.Sphere/Post/PostService.cs
+++ b/DysonNetwork.Sphere/Post/PostService.cs
@@ -740,14 +740,16 @@ public partial class PostService(
if (featuredIds is null)
{
+ // The previous day highest rated posts
var today = SystemClock.Instance.GetCurrentInstant();
- var periodStart = today.InUtc().Date.AtStartOfDayInZone(DateTimeZone.Utc).ToInstant().Minus(Duration.FromDays(7));
- var periodEnd = today.InUtc().Date.PlusDays(1).AtStartOfDayInZone(DateTimeZone.Utc).ToInstant();
-
+ var periodStart = today.InUtc().Date.AtStartOfDayInZone(DateTimeZone.Utc).ToInstant().Minus(Duration.FromDays(1));
+ var periodEnd = today.InUtc().Date.AtStartOfDayInZone(DateTimeZone.Utc).ToInstant();
+
var reactSocialPoints = await db.PostReactions
.Include(e => e.Post)
.Where(e => e.Post.Visibility == PostVisibility.Public)
.Where(e => e.CreatedAt >= periodStart && e.CreatedAt < periodEnd)
+ .Where(e => e.Post.CreatedAt >= periodStart && e.Post.CreatedAt < periodEnd)
.GroupBy(e => e.PostId)
.Select(e => new
{
@@ -755,12 +757,12 @@ public partial class PostService(
Count = e.Sum(r => r.Attitude == PostReactionAttitude.Positive ? 1 : -1)
})
.OrderByDescending(e => e.Count)
- .Take(3)
+ .Take(5)
.ToDictionaryAsync(e => e.PostId, e => e.Count);
featuredIds = reactSocialPoints.Select(e => e.Key).ToList();
- await cache.SetAsync(FeaturedPostCacheKey, featuredIds, TimeSpan.FromMinutes(5));
+ await cache.SetAsync(FeaturedPostCacheKey, featuredIds, TimeSpan.FromHours(24));
}
var posts = await db.Posts
@@ -810,4 +812,4 @@ public static class PostQueryExtensions
(e.Publisher.AccountId != null && userFriends.Contains(e.Publisher.AccountId.Value)) ||
publishersId.Contains(e.PublisherId));
}
-}
\ No newline at end of file
+}
diff --git a/DysonNetwork.sln.DotSettings.user b/DysonNetwork.sln.DotSettings.user
index c4becba..77d72ed 100644
--- a/DysonNetwork.sln.DotSettings.user
+++ b/DysonNetwork.sln.DotSettings.user
@@ -104,6 +104,7 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded