forked from MarseyWorld/MarseyWorld
sdf
parent
889a8948c4
commit
82a749e9e3
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue