This commit is contained in:
Aevann1 2021-08-06 14:31:20 +02:00
parent f7d0dfff2d
commit 3fa266f8ac
2 changed files with 8 additions and 3 deletions

View file

@ -126,9 +126,13 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words=''
elif sort == "controversial":
posts = sorted(posts.all(), key=lambda x: x.score_disputed, reverse=True)
elif sort == "top":
time1 = time.time()
posts = sorted(posts.all(), key=lambda x: x.score, reverse=True)
print(time.time() - time1)
elif sort == "bottom":
posts = sorted(posts.all(), key=lambda x: x.score)
time1 = time.time()
posts = posts.order_by(Submission.sexscore.desc()).all()
print(time.time() - time1)
elif sort == "comments":
posts = posts.order_by(Submission.comment_count.desc()).all()
elif sort == "random":