From: Dessalines Date: Fri, 7 Jul 2023 09:29:07 +0000 (-0400) Subject: Revert "Make sure hot rank sorts for post and community filter by positive hot ranks... X-Git-Url: http://these/git/%7B%60https:/%7B%60css/themes/%22https:/nerdica.net/%7BpictshareAvatarThumbnail%28admin.avatar%29%7D?a=commitdiff_plain;h=c208faf276d99d67281cab88f46ecb689d74266d;p=lemmy.git Revert "Make sure hot rank sorts for post and community filter by positive hot ranks. (#3497)" (#3521) This reverts commit 6840fd64f9bee9fff263ed797350a316ebdb98c6. --- diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 07ad40d4..d1e974d8 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -391,14 +391,8 @@ impl<'a> PostQuery<'a> { } query = match self.sort.unwrap_or(SortType::Hot) { - SortType::Active => query - // Hot ranks fade to zero after a few days, and this filter drastically reduces - // 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::Active => query.then_order_by(post_aggregates::hot_rank_active.desc()), + SortType::Hot => query.then_order_by(post_aggregates::hot_rank.desc()), SortType::New => query.then_order_by(post_aggregates::published.desc()), SortType::Old => query.then_order_by(post_aggregates::published.asc()), SortType::NewComments => query.then_order_by(post_aggregates::newest_comment_time.desc()), diff --git a/crates/db_views_actor/src/community_view.rs b/crates/db_views_actor/src/community_view.rs index 991c4cdd..7f05afca 100644 --- a/crates/db_views_actor/src/community_view.rs +++ b/crates/db_views_actor/src/community_view.rs @@ -168,11 +168,7 @@ impl<'a> CommunityQuery<'a> { ); } match self.sort.unwrap_or(Hot) { - Hot | Active => { - query = query - .filter(community_aggregates::hot_rank.gt(1)) - .order_by(community_aggregates::hot_rank.desc()) - } + Hot | Active => query = query.order_by(community_aggregates::hot_rank.desc()), NewComments | TopDay | TopTwelveHour | TopSixHour | TopHour => { query = query.order_by(community_aggregates::users_active_day.desc()) }