forked from rDrama/rDrama
xvc
parent
59ba1e476a
commit
90fc18bcb8
|
@ -262,7 +262,7 @@ class User(Base):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
posts = posts.order_by(Submission.created_utc.asc())
|
posts = posts.order_by(Submission.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
posts = posts.order_by((Submission.downvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1))
|
posts = posts.order_by((Submission.upvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1), Submission.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
|
|
@ -435,7 +435,7 @@ def changeloglist(v=None, sort="new", page=1 ,t="all"):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
posts = posts.order_by(Submission.created_utc.asc())
|
posts = posts.order_by(Submission.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
posts = posts.order_by((Submission.downvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1))
|
posts = posts.order_by((Submission.upvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1), Submission.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
@ -499,7 +499,7 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
|
|
@ -179,7 +179,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.realupvotes.desc())
|
comments = comments.order_by(Comment.realupvotes.desc())
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
@ -198,7 +198,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.realupvotes.desc())
|
comments = comments.order_by(Comment.realupvotes.desc())
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
@ -307,7 +307,7 @@ def viewmore(v, pid, sort, offset):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.realupvotes.desc())
|
comments = comments.order_by(Comment.realupvotes.desc())
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
@ -324,7 +324,7 @@ def viewmore(v, pid, sort, offset):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.realupvotes.desc())
|
comments = comments.order_by(Comment.realupvotes.desc())
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
|
|
@ -149,7 +149,7 @@ def searchposts(v):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
posts = posts.order_by(Submission.created_utc.asc())
|
posts = posts.order_by(Submission.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
posts = posts.order_by((Submission.downvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1))
|
posts = posts.order_by((Submission.upvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1), Submission.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
@ -255,7 +255,7 @@ def searchcomments(v):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
|
|
@ -857,7 +857,7 @@ def u_username_comments(username, v=None):
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
comments = comments.order_by(Comment.created_utc.asc())
|
comments = comments.order_by(Comment.created_utc.asc())
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
comments = comments.order_by((Comment.upvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1), Comment.downvotes.desc())
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
|
|
Loading…
Reference in New Issue