This commit is contained in:
Aevann1 2021-10-10 16:10:46 +02:00
parent 9ae9b8da07
commit 6d3110ed15
17 changed files with 37 additions and 36 deletions

View file

@ -199,7 +199,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":
@ -291,7 +291,7 @@ def changeloglist(v=None, sort="new", page=1 ,t="all"):
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":
@ -361,7 +361,7 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":