forked from rDrama/rDrama
fsd
parent
f3a3729f14
commit
5540d82ce1
|
@ -103,11 +103,11 @@ def notifications(v):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
|
||||||
all = set(x[0] for x in g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False,
|
all = g.db.query(Comment).join(Notification, Notification.comment_id == Comment.id).filter(Comment.is_banned == False,
|
||||||
Comment.deleted_utc == 0,
|
Comment.deleted_utc == 0,
|
||||||
Comment.author_id != AUTOJANNY_ID,
|
Comment.author_id != AUTOJANNY_ID,
|
||||||
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
|
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
|
||||||
).order_by(Comment.top_comment_id.desc()).offset(50 * (page - 1)).limit(100).all())
|
).order_by(Comment.top_comment_id.desc()).offset(50 * (page - 1)).limit(100).all()
|
||||||
|
|
||||||
comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter(
|
comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter(
|
||||||
Notification.user_id == v.id,
|
Notification.user_id == v.id,
|
||||||
|
@ -124,11 +124,11 @@ def notifications(v):
|
||||||
listing = []
|
listing = []
|
||||||
for c in comments:
|
for c in comments:
|
||||||
if c.parent_submission:
|
if c.parent_submission:
|
||||||
c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all]
|
c.replies2 = [x for x in all if x.parent_comment_id == c.id]
|
||||||
cids = cids | set(x.id for x in c.replies2)
|
cids = cids | set(x.id for x in c.replies2)
|
||||||
while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments):
|
while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments):
|
||||||
c = c.parent_comment
|
c = c.parent_comment
|
||||||
c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all]
|
c.replies2 = [x for x in all if x.parent_comment_id == c.id]
|
||||||
cids = cids | set(x.id for x in c.replies2)
|
cids = cids | set(x.id for x in c.replies2)
|
||||||
cids.add(c.id)
|
cids.add(c.id)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue