X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_views%2Fsrc%2Fcomment_view.rs;h=6ac629b5a02d41f8bd0dbe7684b79211e4d27b1f;hb=8cb5939f5048c3eab293884923d4c3d5fcc08e2f;hp=3657d9429e8cbdb9634f2cae43ab1dd51fddefe9;hpb=4e5798852f583a68d123a9c49ae0ef59ec9ffc76;p=lemmy.git diff --git a/crates/db_views/src/comment_view.rs b/crates/db_views/src/comment_view.rs index 3657d942..6ac629b5 100644 --- a/crates/db_views/src/comment_view.rs +++ b/crates/db_views/src/comment_view.rs @@ -36,7 +36,7 @@ use lemmy_db_schema::{ post::Post, }, traits::JoinView, - utils::{functions::hot_rank, fuzzy_search, get_conn, limit_and_offset_unlimited, DbPool}, + utils::{fuzzy_search, get_conn, limit_and_offset_unlimited, DbPool}, CommentSortType, ListingType, }; @@ -346,9 +346,7 @@ impl<'a> CommentQuery<'a> { }; query = match self.sort.unwrap_or(CommentSortType::Hot) { - CommentSortType::Hot => query - .then_order_by(hot_rank(comment_aggregates::score, comment_aggregates::published).desc()) - .then_order_by(comment_aggregates::published.desc()), + CommentSortType::Hot => query.then_order_by(comment_aggregates::hot_rank.desc()), CommentSortType::New => query.then_order_by(comment::published.desc()), CommentSortType::Old => query.then_order_by(comment::published.asc()), CommentSortType::Top => query.order_by(comment_aggregates::score.desc()), @@ -909,6 +907,7 @@ mod tests { downvotes: 0, published: agg.published, child_count: 5, + hot_rank: 1728, }, } }