mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-16 09:24:00 +00:00
Revert "Make sure hot rank sorts for post and community filter by positive hot ranks. (#3497)" (#3521)
This reverts commit 6840fd64f9
.
This commit is contained in:
parent
aa70325c11
commit
c208faf276
2 changed files with 3 additions and 13 deletions
|
@ -391,14 +391,8 @@ impl<'a> PostQuery<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
query = match self.sort.unwrap_or(SortType::Hot) {
|
query = match self.sort.unwrap_or(SortType::Hot) {
|
||||||
SortType::Active => query
|
SortType::Active => query.then_order_by(post_aggregates::hot_rank_active.desc()),
|
||||||
// Hot ranks fade to zero after a few days, and this filter drastically reduces
|
SortType::Hot => query.then_order_by(post_aggregates::hot_rank.desc()),
|
||||||
// the number of rows needed to be joined to.
|
|
||||||
.filter(post_aggregates::hot_rank_active.gt(1))
|
|
||||||
.then_order_by(post_aggregates::hot_rank_active.desc()),
|
|
||||||
SortType::Hot => query
|
|
||||||
.filter(post_aggregates::hot_rank.gt(1))
|
|
||||||
.then_order_by(post_aggregates::hot_rank.desc()),
|
|
||||||
SortType::New => query.then_order_by(post_aggregates::published.desc()),
|
SortType::New => query.then_order_by(post_aggregates::published.desc()),
|
||||||
SortType::Old => query.then_order_by(post_aggregates::published.asc()),
|
SortType::Old => query.then_order_by(post_aggregates::published.asc()),
|
||||||
SortType::NewComments => query.then_order_by(post_aggregates::newest_comment_time.desc()),
|
SortType::NewComments => query.then_order_by(post_aggregates::newest_comment_time.desc()),
|
||||||
|
|
|
@ -168,11 +168,7 @@ impl<'a> CommunityQuery<'a> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
match self.sort.unwrap_or(Hot) {
|
match self.sort.unwrap_or(Hot) {
|
||||||
Hot | Active => {
|
Hot | Active => query = query.order_by(community_aggregates::hot_rank.desc()),
|
||||||
query = query
|
|
||||||
.filter(community_aggregates::hot_rank.gt(1))
|
|
||||||
.order_by(community_aggregates::hot_rank.desc())
|
|
||||||
}
|
|
||||||
NewComments | TopDay | TopTwelveHour | TopSixHour | TopHour => {
|
NewComments | TopDay | TopTwelveHour | TopSixHour | TopHour => {
|
||||||
query = query.order_by(community_aggregates::users_active_day.desc())
|
query = query.order_by(community_aggregates::users_active_day.desc())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue