forked from rDrama/rDrama
sfdfsd
parent
ee56da5969
commit
9a773dc47b
|
@ -171,7 +171,7 @@ def post_id(pid, anything=None, v=None):
|
||||||
comment.is_blocked = c[3] or 0
|
comment.is_blocked = c[3] or 0
|
||||||
output.append(comment)
|
output.append(comment)
|
||||||
|
|
||||||
comments = output
|
comments2 = output
|
||||||
else:
|
else:
|
||||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ID, Comment.level == 1, Comment.is_pinned == None)
|
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ID, Comment.level == 1, Comment.is_pinned == None)
|
||||||
|
|
||||||
|
@ -189,21 +189,21 @@ def post_id(pid, anything=None, v=None):
|
||||||
offset = int(request.values.get("offset", 0))
|
offset = int(request.values.get("offset", 0))
|
||||||
if offset: comments = comments.offset(offset)
|
if offset: comments = comments.offset(offset)
|
||||||
|
|
||||||
comments = comments.all()
|
comments2 = comments.all()
|
||||||
|
|
||||||
comments2 = []
|
if post.created_utc > 1638672040:
|
||||||
count = 0
|
comments2 = []
|
||||||
for comment in comments:
|
count = 0
|
||||||
comments2.append(comment)
|
for comment in comments:
|
||||||
count += g.db.query(Comment.id).filter_by(top_comment_id=comment.id).count() + 1
|
comments2.append(comment)
|
||||||
offset += 1
|
count += g.db.query(Comment.id).filter_by(top_comment_id=comment.id).count() + 1
|
||||||
if count > 10: break
|
offset += 1
|
||||||
|
if count > 10: break
|
||||||
|
|
||||||
if len(comments) == len(comments2): offset = None
|
if len(comments) == len(comments2): offset = None
|
||||||
|
|
||||||
post.replies = pinned + comments2
|
post.replies = pinned + comments2
|
||||||
|
|
||||||
|
|
||||||
if request.host == 'rdrama.net' and pid in [BUG_THREAD, EMOJI_THREAD] and not request.values.get("sort"): post.replies = post.replies[:10]
|
if request.host == 'rdrama.net' and pid in [BUG_THREAD, EMOJI_THREAD] and not request.values.get("sort"): post.replies = post.replies[:10]
|
||||||
|
|
||||||
post.views += 1
|
post.views += 1
|
||||||
|
|
Loading…
Reference in New Issue