forked from rDrama/rDrama
fds
parent
75d83b7a4b
commit
25b149e1f9
|
@ -171,7 +171,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
posts = posts.join(Submission.author).filter(User.shadowbanned == False)
|
||||
|
||||
if sort == "hot":
|
||||
posts = posts.order_by(-10000000*(Submission.upvotes - Submission.downvotes + 1)/(((int(time.time()) - Submission.created_utc + 3600)/1000)*(1.35)))
|
||||
posts = posts.order_by(-1*(Submission.upvotes - Submission.downvotes)/((int(time.time()) - Submission.created_utc)/1000))
|
||||
elif sort == "new":
|
||||
posts = posts.order_by(Submission.created_utc.desc())
|
||||
elif sort == "old":
|
||||
|
@ -185,7 +185,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
elif sort == "comments":
|
||||
posts = posts.order_by(Submission.comment_count.desc())
|
||||
|
||||
posts = posts.offset(25 * (page - 1)).limit(26).all()
|
||||
if sort != "hot": posts = posts.offset(25 * (page - 1)).limit(26).all()
|
||||
|
||||
|
||||
next_exists = (len(posts) > 25)
|
||||
|
||||
|
|
Loading…
Reference in New Issue