⚗️ Adjust the algorithm for both the featured post and the activity feed

This commit is contained in:
2025-09-03 23:44:27 +08:00
parent 7f110313e9
commit 3ee04d0b24
3 changed files with 29 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ public class ActivityService(
var postTime = post.PublishedAt ?? post.CreatedAt;
var hours = (now - postTime).TotalHours;
// Add 1 to score to prevent negative results for posts with more downvotes than upvotes
return (score + 1) / Math.Pow(hours + 2, 1.8);
return (score + 1) / Math.Pow(hours + 1.5, 2.0);
}
public async Task<List<Activity>> GetActivitiesForAnyone(