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,
};
query = query.filter(local_user_language::language_id.is_not_null());
// Don't show blocked communities or persons
- query = query.filter(community_block::person_id.is_null());
+ if self.post_id.is_none() {
+ query = query.filter(community_block::person_id.is_null());
+ }
query = query.filter(person_block::person_id.is_null());
}
};
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()),
downvotes: 0,
published: agg.published,
child_count: 5,
+ hot_rank: 1728,
},
}
}