mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
This commit is contained in:
parent
e78fe5a34c
commit
0868910570
@ -492,8 +492,14 @@ fn queries<'a>() -> Queries<
|
||||
}
|
||||
|
||||
let sorts = [
|
||||
// featured posts first
|
||||
Some((Ord::Desc, featured_field)),
|
||||
// then use the main sort
|
||||
Some(main_sort),
|
||||
// hot rank reaches zero after some days, use publish as fallback. necessary because old
|
||||
// posts can be fetched over federation and inserted with high post id
|
||||
Some((Ord::Desc, field!(published))),
|
||||
// finally use unique post id as tie breaker
|
||||
Some((Ord::Desc, field!(post_id))),
|
||||
];
|
||||
let sorts_iter = sorts.iter().flatten();
|
||||
|
Loading…
Reference in New Issue
Block a user