diff --git a/files/routes/posts.py b/files/routes/posts.py index 03d97ee19..3a40c7d2c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -206,18 +206,11 @@ def post_id(pid, anything=None, v=None, sub=None): if post.comment_count > limit and not request.headers.get("Authorization") and not request.values.get("all"): comments2 = [] count = 0 - if post.created_utc > 1638672040: - for comment in comments: - comments2.append(comment) - ids.add(comment.id) - count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1 - if count > limit: break - else: - for comment in comments: - comments2.append(comment) - ids.add(comment.id) - count += g.db.query(Comment.id).filter_by(parent_submission=post.id, parent_comment_id=comment.id).count() + 1 - if count > limit: break + for comment in comments: + comments2.append(comment) + ids.add(comment.id) + count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1 + if count > limit: break if len(comments) == len(comments2): offset = 0 else: offset = 1 @@ -326,18 +319,11 @@ def viewmore(v, pid, sort, offset): comments2 = [] count = 0 - if post.created_utc > 1638672040: - for comment in comments: - comments2.append(comment) - ids.add(comment.id) - count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1 - if count > limit: break - else: - for comment in comments: - comments2.append(comment) - ids.add(comment.id) - count += g.db.query(Comment.id).filter_by(parent_submission=post.id, parent_comment_id=comment.id).count() + 1 - if count > limit: break + for comment in comments: + comments2.append(comment) + ids.add(comment.id) + count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1 + if count > limit: break if len(comments) == len(comments2): offset = 0 else: offset += 1