From 83552eb1db3f7099a929c7d943aa99bab758bd59 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 14 Feb 2022 04:47:28 +0200 Subject: [PATCH] df --- files/classes/comment.py | 11 ++++++----- files/classes/submission.py | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index e62eaaa865..fffc11b350 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -356,13 +356,14 @@ class Comment(Base): if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60: ti = max(int((time.time() - self.created_utc)/60), 1) - maxupvotes = min(ti, 31) + maxupvotes = min(ti, 6) rand = randint(0, maxupvotes) if self.upvotes < rand: - amount = randint(0, 3) - self.upvotes += amount - g.db.add(self) - g.db.commit() + amount = randint(0, 1) + if amount == 1: + self.upvotes += amount + g.db.add(self) + g.db.commit() for c in self.options: body += f'
time.time() - self.created_utc > 20: ti = max(int((time.time() - self.created_utc)/60), 1) - maxupvotes = min(ti, 27) + maxupvotes = min(ti, 7) rand = random.randint(0, maxupvotes) if self.upvotes < rand: - amount = random.randint(0, 3) - self.views += amount*random.randint(3, 5) - self.upvotes += amount - g.db.add(self) - g.db.commit() + amount = random.randint(0, 1) + if amount == 1: + self.views += amount*random.randint(3, 5) + self.upvotes += amount + g.db.add(self) + g.db.commit() for c in self.options: body += f'