From e15ed001fab690f0df452db3fc927ffe60cd4699 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 26 Aug 2025 07:35:21 +0100 Subject: [PATCH] appview: tweak trending algo a bit sort by most gained stars. Signed-off-by: oppiliappan --- appview/db/star.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appview/db/star.go b/appview/db/star.go index fa2655a8..64812704 100644 --- a/appview/db/star.go +++ b/appview/db/star.go @@ -257,14 +257,15 @@ func GetTopStarredReposLastWeek(e Execer) ([]Repo, error) { repo_star_counts as ( select s.repo_at, - count(*) as star_count + count(*) as stars_gained_last_week from stars s join recent_starred_repos rsr on s.repo_at = rsr.repo_at + where s.created >= datetime('now', '-7 days') group by s.repo_at ) select rsc.repo_at from repo_star_counts rsc - order by rsc.star_count desc + order by rsc.stars_gained_last_week desc limit 8 ` -- 2.51.2