hot sort - more spicy pls (experiment)

This commit is contained in:
rimu 2024-04-14 08:17:02 +12:00
parent 75c3f7c8be
commit 2dcbc45d67

View file

@ -305,15 +305,19 @@ def post_vote(post_id: int, vote_direction):
post.up_votes += 1 post.up_votes += 1
# Make 'hot' sort more spicy by amplifying the effect of early upvotes # Make 'hot' sort more spicy by amplifying the effect of early upvotes
if post.up_votes + post.down_votes <= 10: if post.up_votes + post.down_votes <= 10:
post.score += 10
elif post.up_votes + post.down_votes <= 30:
post.score += 5 post.score += 5
elif post.up_votes + post.down_votes <= 100: elif post.up_votes + post.down_votes <= 60:
post.score += 2 post.score += 2
else: else:
post.score += 1 post.score += 1
else: else:
effect = -1 effect = -1
post.down_votes += 1 post.down_votes += 1
if post.up_votes + post.down_votes <= 100: if post.up_votes + post.down_votes <= 30:
post.score -= 5
elif post.up_votes + post.down_votes <= 60:
post.score -= 2 post.score -= 2
else: else:
post.score -= 1 post.score -= 1