From 69b4ddc11d83d74d5ff28a5ffd3e11010e3fde07 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 00:11:01 +0200 Subject: [PATCH 01/86] test --- files/routes/front.py | 13 ++----------- files/templates/votes.html | 12 +++++++++--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 68819bd25..870501c83 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -88,12 +88,12 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - notifications = v.notifications.join(Notification.comment).filter( + notifications = v.notifications.join(Notification.comment).distinct(Comment.top_comment_id).filter( Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: {{vote.user.username}} - {{vote.user.truecoins}} + {{vote.user.truecoins}} {% endfor %}

Downvotes

- + + + + {% for vote in downs %} - + + + + {% endfor %}
User
UserUser truescore
{{vote.user.username}}
{{vote.user.username}}{{vote.user.truecoins}}
From 1665680523c4c84f29d4382c1f55a5d793fe9fc8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 00:26:09 +0200 Subject: [PATCH 02/86] sfd --- files/routes/front.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 870501c83..90e8cd1a7 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -37,6 +37,7 @@ def unread(v): @app.get("/notifications") @auth_required def notifications(v): + t = time.time() try: page = int(request.values.get('page', 1)) except: page = 1 messages = request.values.get('messages') @@ -88,6 +89,13 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: + all = [x.comment_id for x in v.notifications.join(Notification.comment).filter( + Comment.is_banned == False, + Comment.deleted_utc == 0, + Comment.author_id != AUTOJANNY_ID, + Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 00:27:18 +0200 Subject: [PATCH 03/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 90e8cd1a7..1c6fd2ceb 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -89,12 +89,12 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - all = [x.comment_id for x in v.notifications.join(Notification.comment).filter( + all = set([x.comment_id for x in v.notifications.join(Notification.comment).filter( Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 00:30:32 +0200 Subject: [PATCH 05/86] fsd --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 0af4e9b8d..360efb41d 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -89,12 +89,12 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - all = set([x.comment_id for x in v.notifications.join(Notification.comment).filter( + all = [x.comment_id for x in v.notifications.join(Notification.comment).filter( Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention:

New rdrama mention:

New rdrama mention:

New rdrama mention: 50) - notifications = notifications[:50] - cids = [x.comment_id for x in notifications] - comments = get_comments(cids, v=v, load_parent=True) + next_exists = (len(comments) > 50) + comments = comments[:50] + + + cids = set() - i = 0 - for x in notifications: - try: c = comments[i] - except: continue - if not x.read: c.unread = True - if x.created_utc > 1620391248: c.notif_utc = x.created_utc - x.read = True - g.db.add(x) - i += 1 - g.db.commit() - if not posts and not reddit: listing = [] for c in comments: @@ -126,7 +131,9 @@ def notifications(v): while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): 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 c.child_comments if c.author_id == v.id or x.id in all] + cids.update([x.id for x in c.replies2]) + cids.add(c.id) + comms = get_comments(list(cids), v=v) else: while c.parent_comment: c = c.parent_comment From 6fef3467037367c5dd8a4f482e02253e70ac5254 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:03:46 +0200 Subject: [PATCH 09/86] sfd --- files/routes/front.py | 58 +++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index c683ca639..4654d586b 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -38,6 +38,7 @@ def unread(v): @auth_required def notifications(v): t = time.time() + try: page = int(request.values.get('page', 1)) except: page = 1 messages = request.values.get('messages') @@ -49,10 +50,9 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] elif messages: - comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() + comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, not_(Comment.child_comments.any())).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() next_exists = (len(comments) > 25) comments = comments[:25] - comments = [x.parent_comm] elif posts: notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all() @@ -90,50 +90,38 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - unread = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter( - Notification.read == False, - Notification.user_id == v.id, - Comment.author_id != AUTOJANNY_ID, - Comment.body_html.notlike('

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 01:05:21 +0200 Subject: [PATCH 10/86] dsf --- files/routes/front.py | 58 ++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4654d586b..c2d932748 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -38,7 +38,6 @@ def unread(v): @auth_required def notifications(v): t = time.time() - try: page = int(request.values.get('page', 1)) except: page = 1 messages = request.values.get('messages') @@ -50,9 +49,10 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] elif messages: - comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, not_(Comment.child_comments.any())).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() + comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() next_exists = (len(comments) > 25) comments = comments[:25] + comments = [x.parent_comm] elif posts: notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all() @@ -90,38 +90,49 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - notifications = v.notifications.join(Notification.comment).distinct(Comment.top_comment_id).filter( + unread = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter( + Notification.read == False, + Notification.user_id == v.id, + Comment.author_id != AUTOJANNY_ID, + Comment.body_html.notlike('

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 01:07:18 +0200 Subject: [PATCH 11/86] fdsfsd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index c2d932748..faae44385 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -140,7 +140,7 @@ def notifications(v): if c not in listing: listing.append(c) - if c.parent_submission: comms = get_comments(list(cids), v=v) + comms = get_comments(list(cids), v=v) if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} From aaf3da70d2704c2ac2e2b2e2bc16678e7cf7b8e7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:07:55 +0200 Subject: [PATCH 12/86] fsd --- files/routes/front.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/front.py b/files/routes/front.py index faae44385..656aeec74 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -140,6 +140,7 @@ def notifications(v): if c not in listing: listing.append(c) + print(cids) comms = get_comments(list(cids), v=v) if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} From 4e10e05dbb64723f6e723bce3fef70be54ba9b4b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:15:57 +0200 Subject: [PATCH 13/86] fds --- files/routes/front.py | 47 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 656aeec74..861c6b61c 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -54,36 +54,34 @@ def notifications(v): comments = comments[:25] comments = [x.parent_comm] elif posts: - notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all() + notifications = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter(Notification.user_id == v.id, Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all() listing = [] - for index, x in enumerate(notifications[:100]): - c = x.comment - if x.read and index > 24: break - elif not x.read: - x.read = True + for index, n. c in enumerate(notifications[:100]): + if n.read and index > 24: break + elif not n.read: + n.read = True c.unread = True - g.db.add(x) - if x.created_utc > 1620391248: c.notif_utc = x.created_utc + g.db.add(n) + if n.created_utc > 1620391248: c.notif_utc = n.created_utc listing.append(c) g.db.commit() next_exists = (len(notifications) > len(listing)) elif reddit: - notifications = v.notifications.join(Notification.comment).filter(Comment.body_html.like('

New rdrama mention: 24: break - elif not x.read: - x.read = True + for index, n, c in enumerate(notifications[:100]): + if n.read and index > 24: break + elif not n.read: + n.read = True c.unread = True - g.db.add(x) - if x.created_utc > 1620391248: c.notif_utc = x.created_utc + g.db.add(n) + if n.created_utc > 1620391248: c.notif_utc = n.created_utc listing.append(c) g.db.commit() @@ -95,20 +93,19 @@ def notifications(v): Notification.user_id == v.id, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:21:06 +0200 Subject: [PATCH 14/86] fds --- files/classes/user.py | 5 ----- files/routes/front.py | 15 +++++++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index b4214b5c1..3f8913c3e 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -187,11 +187,6 @@ class User(Base): def csslazy(self): return self.css - @property - @lazy - def notifications(self): - return g.db.query(Notification).filter_by(user_id=self.id) - @property @lazy def created_date(self): diff --git a/files/routes/front.py b/files/routes/front.py index 861c6b61c..34abb8384 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -9,7 +9,8 @@ defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip() @app.post("/clear") @auth_required def clear(v): - for n in v.notifications.filter_by(read=False).all(): + notifs = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter(Notification.read == False, Notification.user_id == v.id).all() + for n in notifs: n.read = True g.db.add(n) g.db.commit() @@ -18,7 +19,7 @@ def clear(v): @app.get("/unread") @auth_required def unread(v): - listing = g.db.query(Comment).join(Notification.comment).filter( + listing = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter( Notification.read == False, Notification.user_id == v.id, Comment.is_banned == False, @@ -26,12 +27,12 @@ def unread(v): Comment.author_id != AUTOJANNY_ID, ).order_by(Notification.created_utc.desc()).all() - for n in v.notifications.filter_by(read=False).all(): + for n, c in listing: n.read = True g.db.add(n) g.db.commit() - return {"data":[x.json for x in listing]} + return {"data":[x[1].json for x in listing]} @app.get("/notifications") @@ -58,7 +59,8 @@ def notifications(v): listing = [] - for index, n. c in enumerate(notifications[:100]): + for index, x in enumerate(notifications[:100]): + n, c = x if n.read and index > 24: break elif not n.read: n.read = True @@ -75,7 +77,8 @@ def notifications(v): listing = [] - for index, n, c in enumerate(notifications[:100]): + for index, x in enumerate(notifications[:100]): + n, c = x if n.read and index > 24: break elif not n.read: n.read = True From fc1749f9f4fa6ca3dd6bcb8fa83e66e58124c7c0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:24:59 +0200 Subject: [PATCH 15/86] fds --- files/routes/front.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 34abb8384..e2fb38900 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -48,12 +48,11 @@ def notifications(v): if modmail and v.admin_level > 1: comments = g.db.query(Comment).filter(Comment.sentto==2).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() next_exists = (len(comments) > 25) - comments = comments[:25] + listing = comments[:25] elif messages: comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all() next_exists = (len(comments) > 25) - comments = comments[:25] - comments = [x.parent_comm] + listing = comments[:25] elif posts: notifications = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter(Notification.user_id == v.id, Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all() @@ -104,11 +103,11 @@ def notifications(v): 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 = set([x[0] for x in g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:28:54 +0200 Subject: [PATCH 17/86] sdf --- files/routes/front.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index bdaf5e708..db7b07ccf 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -124,11 +124,12 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: - cids.add(c.id) + c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] + 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): - c = c.parent_comment c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] cids = cids | set(x.id for x in c.replies2) + c = c.parent_comment cids.add(c.id) else: while c.parent_comment: From f3a3729f14962bd4efadef1a313a85f6cbc013cf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:29:07 +0200 Subject: [PATCH 18/86] gf --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index db7b07ccf..4954bedf4 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -127,9 +127,9 @@ def notifications(v): c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] 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): + c = c.parent_comment c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] cids = cids | set(x.id for x in c.replies2) - c = c.parent_comment cids.add(c.id) else: while c.parent_comment: From 5540d82ce18ff0611174dbd5567b9daf172f216f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:32:42 +0200 Subject: [PATCH 19/86] fsd --- files/routes/front.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4954bedf4..064eb821a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -103,11 +103,11 @@ def notifications(v): 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.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention:

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 01:38:44 +0200 Subject: [PATCH 22/86] dfs --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index c1800ede3..c23bc722a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,6 +125,7 @@ def notifications(v): for c in comments: if c.parent_submission: c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] + if c.id == 1661969: print(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): c = c.parent_comment @@ -138,7 +139,6 @@ def notifications(v): if c not in listing: listing.append(c) - print(cids) comms = get_comments(list(cids), v=v) if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} From f84eff3055f000e81f44a0a5487542b15788db19 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:44:54 +0200 Subject: [PATCH 23/86] pain --- files/classes/comment.py | 2 +- files/routes/front.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index c12418b20..6d1f79914 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -54,7 +54,7 @@ class Comment(Base): author = relationship("User", primaryjoin="User.id==Comment.author_id") senttouser = relationship("User", primaryjoin="User.id==Comment.sentto", viewonly=True) parent_comment = relationship("Comment", remote_side=[id], viewonly=True) - child_comments = relationship("Comment", remote_side=[parent_comment_id], viewonly=True) + child_comments = relationship("Comment", lazy="dynamic", remote_side=[parent_comment_id], viewonly=True) awards = relationship("AwardRelationship", viewonly=True) reports = relationship("CommentFlag", viewonly=True) diff --git a/files/routes/front.py b/files/routes/front.py index c23bc722a..9030bff15 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -124,13 +124,13 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: - c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] - if c.id == 1661969: print(c.replies2) - cids = cids | set(x.id for x in c.replies2) + if not c.replies2: + c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() + cids.update(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): c = c.parent_comment - c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] - cids = cids | set(x.id for x in c.replies2) + c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() + cids.update(x.id for x in c.replies2) cids.add(c.id) else: while c.parent_comment: From 999dfedb0c701fa60d27f78341e9c5faf2561cf2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:45:24 +0200 Subject: [PATCH 24/86] sfd --- files/routes/front.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 9030bff15..b448f541c 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -129,8 +129,9 @@ def notifications(v): cids.update(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): c = c.parent_comment - c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() - cids.update(x.id for x in c.replies2) + if not c.replies2: + c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() + cids.update(x.id for x in c.replies2) cids.add(c.id) else: while c.parent_comment: From e5d19268b406cb4bc6172a2b5d7e3aeef97c4963 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:47:28 +0200 Subject: [PATCH 25/86] sdf --- files/routes/front.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index b448f541c..3d4ddaf02 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -124,12 +124,16 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: + print(c.replies2) if not c.replies2: + print('fuq') c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() cids.update(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): c = c.parent_comment - if not c.replies2: + print(c.replies2) + if not c.replies2: + print('ni') c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() cids.update(x.id for x in c.replies2) cids.add(c.id) From 5f5bcbb3791639c24896dc67dde10a96645bdf5c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:47:43 +0200 Subject: [PATCH 26/86] fds --- files/routes/front.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 3d4ddaf02..bedc8aa4d 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -131,9 +131,9 @@ def notifications(v): cids.update(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): c = c.parent_comment - print(c.replies2) - if not c.replies2: - print('ni') + print(c.replies2) + if not c.replies2: + print('ni') c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() cids.update(x.id for x in c.replies2) cids.add(c.id) From b93af5b09dc4dd666980092334b1eab4ed49b119 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:49:25 +0200 Subject: [PATCH 27/86] fds --- files/routes/front.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index bedc8aa4d..38f007c61 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -120,21 +120,19 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] + print("1: " + str(time.time() - t), flush=True) + cids = set() listing = [] for c in comments: if c.parent_submission: - print(c.replies2) if not c.replies2: - print('fuq') - c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() + c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(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): c = c.parent_comment - print(c.replies2) if not c.replies2: - print('ni') - c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all() + c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) cids.add(c.id) else: @@ -144,11 +142,13 @@ def notifications(v): if c not in listing: listing.append(c) + print("2: " + str(time.time() - t), flush=True) + comms = get_comments(list(cids), v=v) if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} - print(time.time() - t, flush=True) + print("3: " + str(time.time() - t), flush=True) return render_template("notifications.html", v=v, notifications=listing, From 798e7e9e55ea018b10f7eb8e36a62211fcf3d049 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:51:00 +0200 Subject: [PATCH 28/86] fsd --- files/routes/front.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 38f007c61..c57ff7dbb 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -102,6 +102,7 @@ def notifications(v): g.db.add(c) g.db.commit() + print("1: " + str(time.time() - t), flush=True) 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, Comment.deleted_utc == 0, @@ -109,6 +110,8 @@ def notifications(v): Comment.body_html.notlike('

New rdrama mention: 25) comments = comments[:25] - print("1: " + str(time.time() - t), flush=True) + print("3: " + str(time.time() - t), flush=True) cids = set() listing = [] @@ -128,12 +131,12 @@ def notifications(v): if c.parent_submission: if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(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): c = c.parent_comment if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(x.id for x in c.replies2) + cids = cids | set(x.id for x in c.replies2) cids.add(c.id) else: while c.parent_comment: @@ -142,13 +145,13 @@ def notifications(v): if c not in listing: listing.append(c) - print("2: " + str(time.time() - t), flush=True) + print("4: " + str(time.time() - t), flush=True) comms = get_comments(list(cids), v=v) if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} - print("3: " + str(time.time() - t), flush=True) + print("5: " + str(time.time() - t), flush=True) return render_template("notifications.html", v=v, notifications=listing, From 3163a1a54d6fddc208a3b96001cca2d437a93b53 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 01:51:56 +0200 Subject: [PATCH 29/86] sdf --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index c57ff7dbb..5161b1ea0 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,11 +104,11 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - 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 = [x[0] for x in g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:52:53 +0200 Subject: [PATCH 30/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 5161b1ea0..f1acd7dca 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,11 +104,11 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - all = [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(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:56:05 +0200 Subject: [PATCH 31/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index f1acd7dca..74d0d2a1e 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -108,7 +108,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:56:19 +0200 Subject: [PATCH 32/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 74d0d2a1e..2d160dedb 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,11 +104,11 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - all = g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False, + all = [x[0] for x in g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:57:47 +0200 Subject: [PATCH 33/86] sfd --- files/routes/front.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 2d160dedb..5d1a85a92 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,11 +104,13 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - all = [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.id).join(Notification).filter( + Notification.user_id == v.id, + Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:58:05 +0200 Subject: [PATCH 34/86] fsd --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 5d1a85a92..048bf72d2 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,13 +104,13 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - all = g.db.query(Comment.id).join(Notification).filter( + all = [x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 01:59:00 +0200 Subject: [PATCH 35/86] sfd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 048bf72d2..4ae5ac8e3 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -132,7 +132,7 @@ def notifications(v): for c in comments: if c.parent_submission: if not c.replies2: - c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id)).all() + c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() 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): c = c.parent_comment From defa5fffb1ce97badbf12baab8a5166ae941e1d2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:00:22 +0200 Subject: [PATCH 36/86] fds --- files/routes/front.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/front.py b/files/routes/front.py index 4ae5ac8e3..0923aa5ff 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -132,11 +132,13 @@ def notifications(v): for c in comments: if c.parent_submission: if not c.replies2: + c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() 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): c = c.parent_comment if not c.replies2: + c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids = cids | set(x.id for x in c.replies2) cids.add(c.id) From 3704949ea5d537e671190c02e3c26c68cf006519 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:01:04 +0200 Subject: [PATCH 37/86] fds --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 0923aa5ff..666346b01 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -110,7 +110,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:02:07 +0200 Subject: [PATCH 38/86] gdf --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 666346b01..602a06814 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -131,13 +131,13 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: - if not c.replies2: + if c.replies2 == None: c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() 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): c = c.parent_comment - if not c.replies2: + if c.replies2: c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids = cids | set(x.id for x in c.replies2) From bbbc1fa943c72360bb4f810c6231a2dc4a4432bf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:02:16 +0200 Subject: [PATCH 39/86] fsd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 602a06814..6d077638a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -137,7 +137,7 @@ def notifications(v): 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): c = c.parent_comment - if c.replies2: + if c.replies2 == None: c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids = cids | set(x.id for x in c.replies2) From c75d44f28b94e2439a11f06f6472fbefd8d74a9e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:03:33 +0200 Subject: [PATCH 40/86] fds --- files/routes/front.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/front.py b/files/routes/front.py index 6d077638a..6233cef91 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -134,12 +134,14 @@ def notifications(v): if c.replies2 == None: c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() + print(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): c = c.parent_comment if c.replies2 == None: c.replies2 = [] c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() + print(c.replies2) cids = cids | set(x.id for x in c.replies2) cids.add(c.id) else: From 75fcc2ed1bdcbf9f67c41ed3c884e9ad3083f991 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:04:22 +0200 Subject: [PATCH 41/86] fds --- files/routes/front.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 6233cef91..c0fa4a245 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -110,7 +110,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:05:06 +0200 Subject: [PATCH 42/86] fds --- files/routes/front.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/front.py b/files/routes/front.py index c0fa4a245..9418ff956 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -133,11 +133,13 @@ def notifications(v): if c.parent_submission: if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() + print(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): c = c.parent_comment if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() + print(c.replies2) cids = cids | set(x.id for x in c.replies2) cids.add(c.id) else: From 5b73881849733f773c1421b3cef42efea7dd36bd Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:05:40 +0200 Subject: [PATCH 43/86] dfs --- files/routes/front.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 9418ff956..2b3a20963 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -133,14 +133,12 @@ def notifications(v): if c.parent_submission: if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - print(c.replies2) - cids = cids | set(x.id for x in c.replies2) + cids.update(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): c = c.parent_comment if not c.replies2: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - print(c.replies2) - cids = cids | set(x.id for x in c.replies2) + cids.update(x.id for x in c.replies2) cids.add(c.id) else: while c.parent_comment: From 6a28bf1f8f2788921819fe8e21c344a15d21a6a9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:06:38 +0200 Subject: [PATCH 44/86] fsd --- files/routes/front.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 2b3a20963..3343fa3bf 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -131,14 +131,18 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: - if not c.replies2: + if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) + for x in c.replies2: + c.resplies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment - if not c.replies2: + if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) + for x in c.replies2: + c.resplies2 = [] cids.add(c.id) else: while c.parent_comment: From f3337453f874fdf2ef07289d3e02ce38376d509d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:06:49 +0200 Subject: [PATCH 45/86] fsd' --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 3343fa3bf..3a46ac0c1 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -131,7 +131,7 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: - if c.replies2 == None: + if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) for x in c.replies2: From 69f6a036cc44b04e9314f17cd3f8dad2b6c1e23a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:09:14 +0200 Subject: [PATCH 46/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 3a46ac0c1..694dc75ce 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -133,14 +133,14 @@ def notifications(v): if c.parent_submission: if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(x.id for x in c.replies2) + cids = cids | set(x.id for x in c.replies2) for x in c.replies2: c.resplies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(x.id for x in c.replies2) + cids = cids | set(x.id for x in c.replies2) for x in c.replies2: c.resplies2 = [] cids.add(c.id) From f8f3b02418c9d92e8d6a4bf3d7c1d753e2765a25 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:10:16 +0200 Subject: [PATCH 47/86] fds --- files/routes/front.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 694dc75ce..0bca31f6f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -133,16 +133,16 @@ def notifications(v): if c.parent_submission: if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids = cids | set(x.id for x in c.replies2) + cids.update(x.id for x in c.replies2) for x in c.replies2: - c.resplies2 = [] + c.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids = cids | set(x.id for x in c.replies2) + cids.update(x.id for x in c.replies2) for x in c.replies2: - c.resplies2 = [] + c.replies2 = [] cids.add(c.id) else: while c.parent_comment: From 6299b891f411f4751a58fdae403239b1448a91eb Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:11:33 +0200 Subject: [PATCH 48/86] fsd --- files/routes/front.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 0bca31f6f..0eee9b34f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -141,8 +141,6 @@ def notifications(v): if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) - for x in c.replies2: - c.replies2 = [] cids.add(c.id) else: while c.parent_comment: From 98e627aa44c7c0f600640aa9a4bbdbdfa6328aa8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:12:12 +0200 Subject: [PATCH 49/86] fsd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 0eee9b34f..d19143f6a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -135,7 +135,7 @@ def notifications(v): c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) for x in c.replies2: - c.replies2 = [] + if c.replies2 == None: c.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: From a5ca1e51e72d3ebd708cf93d2e2116f0cb034e56 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:12:34 +0200 Subject: [PATCH 50/86] gfd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index d19143f6a..09017c747 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -135,7 +135,7 @@ def notifications(v): c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) for x in c.replies2: - if c.replies2 == None: c.replies2 = [] + if x.replies2 == None: x.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: From 781a8beda849cc5b063dc69465e0e732a3adc317 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:13:43 +0200 Subject: [PATCH 51/86] fsd --- files/routes/front.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 09017c747..04f412b10 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -134,8 +134,6 @@ def notifications(v): if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) - for x in c.replies2: - if x.replies2 == None: x.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: From 9fb785500ca62e17aca0f51dfcf8088090eb93f7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:14:39 +0200 Subject: [PATCH 52/86] fsd --- files/routes/front.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/front.py b/files/routes/front.py index 04f412b10..09017c747 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -134,6 +134,8 @@ def notifications(v): if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) + for x in c.replies2: + if x.replies2 == None: x.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: From 9ac10af08f878c6554b6964410f86e3d5ab998d7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:15:10 +0200 Subject: [PATCH 53/86] fsd --- files/routes/front.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 09017c747..8bcf79ace 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -135,7 +135,8 @@ def notifications(v): c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) for x in c.replies2: - if x.replies2 == None: x.replies2 = [] + x.replies2 = x.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() + cids.update(y.id for y in x.replies2) while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): c = c.parent_comment if c.replies2 == None: From 222d9c5cb4cfd2d1666a09f9496f67b1045d4e01 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:17:49 +0200 Subject: [PATCH 54/86] dfs --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 8bcf79ace..1941472cc 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -137,7 +137,7 @@ def notifications(v): for x in c.replies2: x.replies2 = x.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(y.id for y in x.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.id in all): c = c.parent_comment if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() From 305368681d5d667f647ddd75ad2c3d85396076a3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:18:37 +0200 Subject: [PATCH 55/86] fds --- files/routes/front.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 1941472cc..4df5afba6 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -134,9 +134,6 @@ def notifications(v): if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() cids.update(x.id for x in c.replies2) - for x in c.replies2: - x.replies2 = x.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(y.id for y in x.replies2) while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in all): c = c.parent_comment if c.replies2 == None: From 5ff51db7d4e38bddbfa88ef6fee94f0da69a5c55 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:20:24 +0200 Subject: [PATCH 56/86] fds --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4df5afba6..6a76af4a0 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -120,7 +120,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 02:33:22 +0200 Subject: [PATCH 62/86] fds --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 38a342dff..093248b1b 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -132,14 +132,14 @@ def notifications(v): for c in comments: if c.parent_submission: if c.replies2 == None: - c.replies2 = [x for x in c.child_comments if x.author_id == v.id or x.id.in_(all)] + c.replies2 = [x for x in c.child_comments if x.author_id == v.id or x in all] cids.update(x.id for x in c.replies2) for x in c.replies2: if x.replies2 == None: x.replies2 = [] while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in all): c = c.parent_comment if c.replies2 == None: - c.replies2 = [x for x in c.child_comments if x.author_id == v.id or x.id.in_(all)] + c.replies2 = [x for x in c.child_comments if x.author_id == v.id or x in all] cids.update(x.id for x in c.replies2) for x in c.replies2: if x.replies2 == None: x.replies2 = [] From ef8a31c268923619bf74bf0126a915c78165b47c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:38:00 +0200 Subject: [PATCH 63/86] sdf --- files/routes/front.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 093248b1b..e33a7eb23 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -104,16 +104,6 @@ def notifications(v): print("1: " + str(time.time() - t), flush=True) - all = g.db.query(Comment).join(Notification).filter( - Notification.user_id == v.id, - Comment.is_banned == False, - Comment.deleted_utc == 0, - Comment.author_id != AUTOJANNY_ID, - Comment.body_html.notlike('

New rdrama mention: 25) comments = comments[:25] + print("2: " + str(time.time() - t), flush=True) + + all = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( + Notification.user_id == v.id, + Comment.is_banned == False, + Comment.deleted_utc == 0, + Comment.author_id != AUTOJANNY_ID, + Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:39:47 +0200 Subject: [PATCH 64/86] sdf --- files/routes/front.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index e33a7eb23..0d7a032ea 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -117,7 +117,7 @@ def notifications(v): print("2: " + str(time.time() - t), flush=True) - all = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( + cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, @@ -127,20 +127,21 @@ def notifications(v): print("3: " + str(time.time() - t), flush=True) - cids = set() + comms = get_comments(list(cids), v=v) + + print("4: " + str(time.time() - t), flush=True) + listing = [] for c in comments: if c.parent_submission: if c.replies2 == None: - c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(x.id for x in c.replies2) + c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() for x in c.replies2: if x.replies2 == None: x.replies2 = [] - while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in all): + while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids): c = c.parent_comment if c.replies2 == None: - c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(all))).all() - cids.update(x.id for x in c.replies2) + c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() for x in c.replies2: if x.replies2 == None: x.replies2 = [] @@ -152,10 +153,6 @@ def notifications(v): if c not in listing: listing.append(c) - print("4: " + str(time.time() - t), flush=True) - - comms = get_comments(list(cids), v=v) - if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} print("5: " + str(time.time() - t), flush=True) From ea107e996682fcc2915a1c5538404e05d2aa490a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:42:20 +0200 Subject: [PATCH 65/86] fsd --- files/templates/comments.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 2e43af1b5..bd93c0fdf 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -111,11 +111,12 @@ {% set score=c.score %} {% if v %} -{% set voted=c.voted %} - + {% set voted=c.voted %} + {% if not voted and v.id == c.author_id %} + {% set voted=1 %} + {% endif %} {% else %} -{% set voted=-2 %} - + {% set voted=-2 %} {% endif %} {% if standalone and level==1 %} From 417a62faefe6847767a2a55a21593dde239b198e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:44:21 +0200 Subject: [PATCH 66/86] fsd --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 0d7a032ea..4c278b433 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -117,13 +117,13 @@ def notifications(v): print("2: " + str(time.time() - t), flush=True) - cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( + cids = [x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:46:06 +0200 Subject: [PATCH 67/86] fds --- files/routes/front.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4c278b433..3ade2adda 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,12 +125,9 @@ def notifications(v): Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:47:47 +0200 Subject: [PATCH 68/86] fds --- files/routes/front.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 3ade2adda..67489440f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -102,7 +102,7 @@ def notifications(v): g.db.add(c) g.db.commit() - print("1: " + str(time.time() - t), flush=True) + # print("1: " + str(time.time() - t), flush=True) comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter( Notification.user_id == v.id, @@ -115,8 +115,7 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] - print("2: " + str(time.time() - t), flush=True) - + print(sex = time.time()) cids = [x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, @@ -124,9 +123,20 @@ def notifications(v): Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:48:16 +0200 Subject: [PATCH 69/86] fsd --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 67489440f..3f125c0e3 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -115,7 +115,7 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] - print(sex = time.time()) + sex = time.time() cids = [x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, @@ -125,7 +125,7 @@ def notifications(v): ).order_by(Comment.top_comment_id.desc()).all()] print(time.time() - sex) - print(sex = time.time()) + sex = time.time() cids = g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, From b0fc109f3040c7dcae04dd51020160909dd9bbf7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:49:12 +0200 Subject: [PATCH 70/86] fds --- files/routes/front.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 3f125c0e3..067ad222a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -136,29 +136,29 @@ def notifications(v): print(time.time() - sex) - # print("3: " + str(time.time() - t), flush=True) + # # print("3: " + str(time.time() - t), flush=True) - listing = [] - for c in comments: - if c.parent_submission: - if c.replies2 == None: - c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() - for x in c.replies2: - if x.replies2 == None: x.replies2 = [] - while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids): - c = c.parent_comment - if c.replies2 == None: - c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() - for x in c.replies2: - if x.replies2 == None: x.replies2 = [] - else: - while c.parent_comment: - c = c.parent_comment - c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).order_by(Comment.id).all() + # listing = [] + # for c in comments: + # if c.parent_submission: + # if c.replies2 == None: + # c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() + # for x in c.replies2: + # if x.replies2 == None: x.replies2 = [] + # while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids): + # c = c.parent_comment + # if c.replies2 == None: + # c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() + # for x in c.replies2: + # if x.replies2 == None: x.replies2 = [] + # else: + # while c.parent_comment: + # c = c.parent_comment + # c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).order_by(Comment.id).all() - if c not in listing: listing.append(c) + # if c not in listing: listing.append(c) - if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} + # if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} # print("5: " + str(time.time() - t), flush=True) return render_template("notifications.html", From f93309a87580b9fb0aa65da36f90d6dfd7a9f496 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:49:40 +0200 Subject: [PATCH 71/86] sdf --- files/routes/front.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 067ad222a..dd42272c4 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -161,14 +161,16 @@ def notifications(v): # if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} # print("5: " + str(time.time() - t), flush=True) - return render_template("notifications.html", - v=v, - notifications=listing, - next_exists=next_exists, - page=page, - standalone=True, - render_replies=True - ) + # return render_template("notifications.html", + # v=v, + # notifications=listing, + # next_exists=next_exists, + # page=page, + # standalone=True, + # render_replies=True + # ) + + return 'fuq' @app.get("/") From 3a6c785d031d984573424878f788acc328963c99 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:51:46 +0200 Subject: [PATCH 72/86] fsd --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index dd42272c4..b66b4121f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -126,7 +126,7 @@ def notifications(v): print(time.time() - sex) sex = time.time() - cids = g.db.query(Comment.id).join(Notification).filter( + cids = g.db.query(Comment).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, From 5214f81d4955a7c96538771f3b8eeba16cdadc1f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:54:53 +0200 Subject: [PATCH 73/86] fds --- files/routes/front.py | 76 ++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 44 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index b66b4121f..929cd83dc 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -102,7 +102,7 @@ def notifications(v): g.db.add(c) g.db.commit() - # print("1: " + str(time.time() - t), flush=True) + print("1: " + str(time.time() - t), flush=True) comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter( Notification.user_id == v.id, @@ -115,62 +115,50 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] - sex = time.time() - cids = [x[0] for x in g.db.query(Comment.id).join(Notification).filter( - Notification.user_id == v.id, - Comment.is_banned == False, - Comment.deleted_utc == 0, - Comment.author_id != AUTOJANNY_ID, - Comment.body_html.notlike('

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 02:55:00 +0200 Subject: [PATCH 74/86] sdf --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 929cd83dc..7085f38da 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -150,7 +150,7 @@ def notifications(v): if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} - print("5: " + str(time.time() - t), flush=True) + print("4: " + str(time.time() - t), flush=True) return render_template("notifications.html", v=v, notifications=listing, From 4215e3079d5a3bed4e574310a4ed6ae4ec0fb95f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 02:56:16 +0200 Subject: [PATCH 75/86] fds --- files/routes/front.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 7085f38da..2d2d449a8 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -117,30 +117,35 @@ def notifications(v): print("2: " + str(time.time() - t), flush=True) - cids = g.db.query(Comment).join(Notification).filter( + cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 02:59:22 +0200 Subject: [PATCH 76/86] fds --- files/routes/front.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 2d2d449a8..87ddd12f2 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -117,13 +117,13 @@ def notifications(v): print("2: " + str(time.time() - t), flush=True) - cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( + cids = set(x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 03:00:50 +0200 Subject: [PATCH 77/86] fds] --- files/routes/front.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 87ddd12f2..2d2d449a8 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -117,13 +117,13 @@ def notifications(v): print("2: " + str(time.time() - t), flush=True) - cids = set(x[0] for x in g.db.query(Comment.id).join(Notification).filter( + cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 03:02:03 +0200 Subject: [PATCH 78/86] fs --- files/routes/front.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/front.py b/files/routes/front.py index 2d2d449a8..a78d10b99 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -133,6 +133,7 @@ def notifications(v): listing = [] for c in comments: + print(c.id, flush=True) if c.parent_submission: if c.replies2 == None: c.replies2 = c.child_comments.filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).all() From 4927bba558147e5240c5b7b6bb67d5df22bfcc81 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 03:03:13 +0200 Subject: [PATCH 79/86] fds --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index a78d10b99..0343677ce 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -110,7 +110,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention:

New rdrama mention:

New rdrama mention:

New rdrama mention: Date: Mon, 4 Apr 2022 03:20:09 +0200 Subject: [PATCH 84/86] fds --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 815d6d01a..7a542c0b7 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,7 +125,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 03:21:36 +0200 Subject: [PATCH 85/86] fds --- files/routes/front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/front.py b/files/routes/front.py index 7a542c0b7..815d6d01a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,7 +125,7 @@ def notifications(v): Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: Date: Mon, 4 Apr 2022 03:24:48 +0200 Subject: [PATCH 86/86] fds --- files/routes/front.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 815d6d01a..8cc72b9d7 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -102,8 +102,6 @@ def notifications(v): g.db.add(c) g.db.commit() - print("1: " + str(time.time() - t), flush=True) - sq = g.db.query(Comment.id).join(Notification).distinct(Comment.top_comment_id).filter( Notification.user_id == v.id, Comment.is_banned == False, @@ -117,8 +115,6 @@ def notifications(v): next_exists = (len(comments) > 25) comments = comments[:25] - print("2: " + str(time.time() - t), flush=True) - cids = set([x[0] for x in g.db.query(Comment.id).join(Notification).filter( Notification.user_id == v.id, Comment.is_banned == False, @@ -127,12 +123,8 @@ def notifications(v): Comment.body_html.notlike('

New rdrama mention: