From daf915a5226825772a138758de4797c9138a2e13 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 2 Sep 2021 21:24:50 +0200 Subject: [PATCH] gffg --- files/routes/front.py | 4 +++- files/routes/posts.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4d872377c..8e74b0bb6 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -186,9 +186,11 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' if random.random() < 0.004: for post in posts: if post.author and post.author.shadowbanned: + rand = random.randint(5,20) + if post.score > rand: continue rand = random.randint(500,1400) vote = Vote(user_id=rand, - vote_type=random.choice([-1, 1]), + vote_type=random.choice([-1, 1, 1, 1, 1]), submission_id=post.id) g.db.add(vote) try: g.db.flush() diff --git a/files/routes/posts.py b/files/routes/posts.py index bdc088225..0539b2de8 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -166,9 +166,11 @@ def post_id(pid, anything=None, v=None): if random.random() < 0.02: for comment in comments: if comment.author and comment.author.shadowbanned: + rand = random.randint(5,20) + if comment.score > rand: continue rand = random.randint(500,1400) vote = CommentVote(user_id=rand, - vote_type=random.choice([-1, 1]), + vote_type=random.choice([-1, 1, 1, 1, 1]), comment_id=comment.id) g.db.add(vote) try: g.db.flush()