]> Untitled Git - lemmy.git/commitdiff
Revert "Make sure hot rank sorts for post and community filter by positive hot ranks...
authorDessalines <dessalines@users.noreply.github.com>
Fri, 7 Jul 2023 09:29:07 +0000 (05:29 -0400)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2023 09:29:07 +0000 (11:29 +0200)
This reverts commit 6840fd64f9bee9fff263ed797350a316ebdb98c6.

crates/db_views/src/post_view.rs
crates/db_views_actor/src/community_view.rs

index 07ad40d456910be0e5cfc02d104554cad5bb6268..d1e974d8a107290211abbfb034bcde694116ede6 100644 (file)
@@ -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()),
index 991c4cdd5df11dad4510ca5672b2d0d90dd13d6e..7f05afca9068272cbfaa379683ad96f32098b28f 100644 (file)
@@ -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())
       }