forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: tweak trending algo a bit

sort by most gained stars.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li e15ed001 8dae47cf

verified
Changed files
+3 -2
appview
db
+3 -2
appview/db/star.go
···
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
`