master
Aevann1 2022-04-04 04:01:06 +02:00
parent 889a8948c4
commit 82a749e9e3
1 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ def notifications(v):
g.db.add(c)
g.db.commit()
sq = g.db.query(Comment.id).join(Notification).distinct(Comment.top_comment_id).filter(
sq = g.db.query(Comment.id, Notification.created_utc).join(Notification).distinct(Comment.top_comment_id).filter(
Notification.user_id == v.id,
Comment.is_banned == False,
Comment.deleted_utc == 0,
@ -110,7 +110,7 @@ def notifications(v):
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
).order_by(Comment.top_comment_id).subquery()
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
next_exists = (len(comments) > 25)
comments = comments[:25]
@ -121,7 +121,7 @@ def notifications(v):
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()).offset(25 * (page - 1)).limit(500).all()] + [x.id for x in comments])
).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(500).all()] + [x.id for x in comments])
comms = get_comments(list(cids), v=v)