diff --git a/files/classes/comment.py b/files/classes/comment.py index 28a3ba076..9f5ed80c4 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -425,7 +425,7 @@ class Comment(Base): if self.is_banned: return True - if path.startswith('/post') and (self.slots_result or self.blackjack_result or self.wordle_result) and (not self.body or len(self.body) <= 50) and 9 > self.level > 1: return True + if path.startswith('/post') and (self.slots_result or self.blackjack_result or self.wordle_result) and (not self.body or len(self.body_html) <= 100) and 9 > self.level > 1: return True if v and v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True diff --git a/files/routes/posts.py b/files/routes/posts.py index 438b20368..14432034f 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -189,8 +189,8 @@ def post_id(pid, anything=None, v=None, sub=None): elif sort == "bottom": comments = comments.order_by(Comment.upvotes - Comment.downvotes) - first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 50)).all()] - second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 50).all()] + first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all()] + second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()] comments = first + second else: pinned = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.is_pinned != None).all() @@ -208,8 +208,8 @@ def post_id(pid, anything=None, v=None, sub=None): elif sort == "bottom": comments = comments.order_by(Comment.upvotes - Comment.downvotes) - first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 50)).all() - second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 50).all() + first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all() + second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all() comments = first + second offset = 0 @@ -322,8 +322,8 @@ def viewmore(v, pid, sort, offset): elif sort == "bottom": comments = comments.order_by(Comment.upvotes - Comment.downvotes) - first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 50)).all()] - second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 50).all()] + first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all()] + second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()] comments = first + second else: comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.level == 1, Comment.is_pinned == None, Comment.id.notin_(ids)) @@ -339,8 +339,8 @@ def viewmore(v, pid, sort, offset): elif sort == "bottom": comments = comments.order_by(Comment.upvotes - Comment.downvotes) - first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 50)).all() - second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 50).all() + first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None, Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all() + second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None, Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all() comments = first + second comments = comments[offset:] diff --git a/files/templates/comments.html b/files/templates/comments.html index 2ac685542..5f7f6c30f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -850,7 +850,7 @@ {% if v %} - + {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 30a2cbf00..311b29a09 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -36,7 +36,7 @@ {% endif %} -{% if SITE_NAME == 'rDrama' and not (v and v.has_badge(128)) %} +{% if not (v and v.has_badge(128)) %}