From 39254f19eb7dcbd4a70d9b4456ada0f5bc9891f0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 6 Mar 2022 03:18:10 +0200 Subject: [PATCH] sounding --- files/classes/submission.py | 5 ----- files/templates/comments.html | 12 ++++++------ files/templates/submission.html | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 9cfa350a85..72e6caabed 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -70,11 +70,6 @@ class Submission(Base): def __repr__(self): return f"" - @property - @lazy - def comments2(self): - return g.db.query(Comment.author_id, Comment.created_utc, Comment.id).filter(Comment.parent_submission == self.id, Comment.author_id.notin_((AUTOPOLLER_ID,AUTOBETTER_ID, AUTOCHOICE_ID))).all() - @property @lazy def controversial(self): diff --git a/files/templates/comments.html b/files/templates/comments.html index 80eaedb674..f4841e2b2f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -894,9 +894,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %} @@ -924,9 +924,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 32b98cb43c..e860f67861 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -996,9 +996,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %}