mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
ranking tweak
This commit is contained in:
parent
8fcf2e3a77
commit
45b62e9305
2 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ def show_community(community: Community):
|
|||
posts = posts.filter(or_(Post.domain_id.not_in(domains_ids), Post.domain_id == None))
|
||||
|
||||
if sort == '' or sort == 'hot':
|
||||
posts = posts.order_by(desc(Post.ranking))
|
||||
posts = posts.order_by(desc(Post.ranking)).order_by(desc(Post.posted_at))
|
||||
elif sort == 'top':
|
||||
posts = posts.filter(Post.posted_at > utcnow() - timedelta(days=7)).order_by(desc(Post.score))
|
||||
elif sort == 'new':
|
||||
|
|
|
@ -51,7 +51,7 @@ def show_topic(topic_name):
|
|||
|
||||
# sorting
|
||||
if sort == '' or sort == 'hot':
|
||||
posts = posts.order_by(desc(Post.ranking))
|
||||
posts = posts.order_by(desc(Post.ranking)).order_by(desc(Post.posted_at))
|
||||
elif sort == 'top':
|
||||
posts = posts.filter(Post.posted_at > utcnow() - timedelta(days=7)).order_by(desc(Post.score))
|
||||
elif sort == 'new':
|
||||
|
|
Loading…
Add table
Reference in a new issue