fsdfsd
This commit is contained in:
parent
169a59c01b
commit
fafcdb2334
1 changed files with 10 additions and 4 deletions
|
@ -193,17 +193,23 @@ def post_id(pid, anything=None, v=None):
|
||||||
|
|
||||||
comments = comments.all()
|
comments = comments.all()
|
||||||
|
|
||||||
|
comments2 = []
|
||||||
|
count = 0
|
||||||
if post.created_utc > 1638672040:
|
if post.created_utc > 1638672040:
|
||||||
comments2 = []
|
|
||||||
count = 0
|
|
||||||
for comment in comments:
|
for comment in comments:
|
||||||
comments2.append(comment)
|
comments2.append(comment)
|
||||||
count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1
|
count += g.db.query(Comment.id).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1
|
||||||
offset += 1
|
offset += 1
|
||||||
if count > 50: break
|
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
|
if len(comments) == len(comments2): offset = None
|
||||||
comments = comments2
|
comments = comments2
|
||||||
|
|
||||||
post.replies = pinned + comments
|
post.replies = pinned + comments
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue