From: Dessalines Date: Sun, 16 Aug 2020 15:05:21 +0000 (-0400) Subject: Fixing community search. Fixes #1084 (#1089) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7Bthis.props.imageSrc%7D?a=commitdiff_plain;h=7f97279c488ea7ab3a18fd6e8a0829c8f9594c78;p=lemmy.git Fixing community search. Fixes #1084 (#1089) --- diff --git a/server/lemmy_db/src/community_view.rs b/server/lemmy_db/src/community_view.rs index e68dbd5e..7445cc46 100644 --- a/server/lemmy_db/src/community_view.rs +++ b/server/lemmy_db/src/community_view.rs @@ -232,12 +232,6 @@ impl<'a> CommunityQueryBuilder<'a> { // The view lets you pass a null user_id, if you're not logged in match self.sort { - SortType::Hot => { - query = query - .order_by(hot_rank.desc()) - .then_order_by(number_of_subscribers.desc()) - .filter(user_id.is_null()) - } SortType::New => query = query.order_by(published.desc()).filter(user_id.is_null()), SortType::TopAll => match self.from_user_id { Some(from_user_id) => { @@ -251,7 +245,12 @@ impl<'a> CommunityQueryBuilder<'a> { .filter(user_id.is_null()) } }, - _ => (), + SortType::Hot | _ => { + query = query + .order_by(hot_rank.desc()) + .then_order_by(number_of_subscribers.desc()) + .filter(user_id.is_null()) + }, }; if !self.show_nsfw {