Skip to content

Commit

Permalink
Improve: Improve popular algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed May 4, 2024
1 parent 9cf4876 commit e17000f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions backend/app/controllers/sonolus/levels_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ def info
charts.map do |chart|
[
chart.id,
likes.count { |like| like.chart_id == chart.id } /
likes.count { |like| like.chart_id == chart.id } *
(
[
(
(Time.now.to_i - chart.published_at.to_i) / 1.day.to_f
) - 3,
0
].max.to_f + 1
0.9**
[
(
(Time.now.to_i - chart.published_at.to_i) /
1.day.to_f
) - 1,
0
].max.to_f
)
]
end
Expand Down

0 comments on commit e17000f

Please sign in to comment.