remotes/1693045480750635534/spooky-22
Aevann1 2022-04-04 03:10:47 +02:00
parent 4927bba558
commit 7def94f50e
1 changed files with 4 additions and 2 deletions

View File

@ -104,13 +104,15 @@ def notifications(v):
print("1: " + str(time.time() - t), flush=True)
comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter(
sq = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter(
Notification.user_id == v.id,
Comment.is_banned == False,
Comment.deleted_utc == 0,
Comment.author_id != AUTOJANNY_ID,
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
).order_by(Comment.id.desc(), Comment.top_comment_id.desc()).offset(25 * (page - 1)).limit(26).all()
).order_by(Comment.top_comment_id.desc()).subquery()
comments = g.db.query(sq.c).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()
next_exists = (len(comments) > 25)
comments = comments[:25]