forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-10 07:22:41 +02:00
parent 41dc72d3b3
commit 0313237458
1 changed files with 11 additions and 18 deletions

View File

@ -183,25 +183,18 @@ def post_id(pid, anything=None, v=None):
post.preloaded_comments = [x for x in comments if not (x.author and x.author.shadowbanned) or (v and v.id == x.author_id)]
# unread comment highlight
last_view_utc = session.get(str(post.id))
if not v or v.highlightcomments:
last_view_utc = session.get(str(post.id))
if last_view_utc: last_view_utc = int(last_view_utc)
session[str(post.id)] = int(time.time())
if last_view_utc:
last_view_utc = int(last_view_utc)
session[str(post.id)] = int(time.time())
print(session)
keys = []
for key, val in session.items():
print(key)
if type(val) is int and key not in ['login_nonce','user_id']:
if time.time() - val > 86400: keys.append(key)
print(keys)
for key in keys: session.pop(key)
print(session)
keys = []
for key, val in session.items():
print(key)
if type(val) is int and key not in ['login_nonce','user_id']:
if time.time() - val > 86400: keys.append(key)
for key in keys: session.pop(key)
post.views += 1
g.db.add(post)