From a32c06552f3a76d05d634d7510ed6f27a41327a9 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 8 Aug 2025 23:26:08 +0800 Subject: [PATCH] :necktie: Change the post featured period counting to a week --- DysonNetwork.Sphere/Post/PostService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs index b0e4c1e..87ba8a0 100644 --- a/DysonNetwork.Sphere/Post/PostService.cs +++ b/DysonNetwork.Sphere/Post/PostService.cs @@ -741,13 +741,13 @@ public partial class PostService( if (featuredIds is null) { var today = SystemClock.Instance.GetCurrentInstant(); - var todayStart = today.InUtc().Date.AtStartOfDayInZone(DateTimeZone.Utc).ToInstant(); - var todayEnd = today.InUtc().Date.PlusDays(1).AtStartOfDayInZone(DateTimeZone.Utc).ToInstant(); - + 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 reactSocialPoints = await db.PostReactions .Include(e => e.Post) .Where(e => e.Post.Visibility == PostVisibility.Public) - .Where(e => e.CreatedAt >= todayStart && e.CreatedAt < todayEnd) + .Where(e => e.CreatedAt >= periodStart && e.CreatedAt < periodEnd) .GroupBy(e => e.PostId) .Select(e => new {