Merge branch 'master' into mistletoe

remotes/1693045480750635534/spooky-22
kek7198 2021-12-05 11:52:58 -06:00
commit db306e3ebc
1 changed files with 10 additions and 4 deletions

View File

@ -193,17 +193,23 @@ def post_id(pid, anything=None, v=None):
comments = comments.all()
comments2 = []
count = 0
if post.created_utc > 1638672040:
comments2 = []
count = 0
for comment in comments:
comments2.append(comment)
count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1
offset += 1
if count > 50: break
else:
for comment in comments:
comments2.append(comment)
count += g.db.query(Comment.id).filter_by(parent_submission=post.id, parent_comment_id=comment.id).count() + 1
offset += 1
if count > 10: break
if len(comments) == len(comments2): offset = None
comments = comments2
if len(comments) == len(comments2): offset = None
comments = comments2
post.replies = pinned + comments