From 2de302006a70bbf6dc88181a9ca17c1a8f92518d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 23 Nov 2021 21:28:29 +0200 Subject: [PATCH] fdfd --- files/classes/comment.py | 4 ++-- files/classes/submission.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index c29933214..18932c696 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -330,9 +330,9 @@ class Comment(Base): body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}") if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60: - ti = int((time.time() - self.created_utc)/60) + ti = max(int((time.time() - self.created_utc)/60), 1) maxupvotes = min(ti, 31) - rand = randint(1, maxupvotes) + rand = randint(0, maxupvotes) if self.upvotes < rand: self.upvotes += randint(0, 5) g.db.add(self) diff --git a/files/classes/submission.py b/files/classes/submission.py index 6b69af694..2ab1d9940 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -330,9 +330,9 @@ class Submission(Base): if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20: - ti = int((time.time() - self.created_utc)/60) + ti = max(int((time.time() - self.created_utc)/60), 1) maxupvotes = min(ti, 27) - rand = random.randint(1, maxupvotes) + rand = random.randint(0, maxupvotes) if self.upvotes < rand: self.upvotes += random.randint(0, 5) g.db.add(self)