mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-03 00:31:58 +00:00
move line
This commit is contained in:
parent
16c7994023
commit
ada5f8be5d
1 changed files with 5 additions and 5 deletions
|
@ -220,11 +220,6 @@ fn queries<'a>() -> Queries<
|
||||||
query = query.filter(person_block::person_id.is_null());
|
query = query.filter(person_block::person_id.is_null());
|
||||||
}
|
}
|
||||||
|
|
||||||
// distinguished comments should go first when viewing post
|
|
||||||
if options.post_id.is_some() || options.parent_path.is_some() {
|
|
||||||
query = query.order_by(comment::distinguished.desc());
|
|
||||||
}
|
|
||||||
|
|
||||||
// A Max depth given means its a tree fetch
|
// A Max depth given means its a tree fetch
|
||||||
let (limit, offset) = if let Some(max_depth) = options.max_depth {
|
let (limit, offset) = if let Some(max_depth) = options.max_depth {
|
||||||
let depth_limit = if let Some(parent_path) = options.parent_path.as_ref() {
|
let depth_limit = if let Some(parent_path) = options.parent_path.as_ref() {
|
||||||
|
@ -258,6 +253,11 @@ fn queries<'a>() -> Queries<
|
||||||
limit_and_offset(options.page, options.limit)?
|
limit_and_offset(options.page, options.limit)?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// distinguished comments should go first when viewing post
|
||||||
|
if options.post_id.is_some() || options.parent_path.is_some() {
|
||||||
|
query = query.order_by(comment::distinguished.desc());
|
||||||
|
}
|
||||||
|
|
||||||
query = match options.sort.unwrap_or(CommentSortType::Hot) {
|
query = match options.sort.unwrap_or(CommentSortType::Hot) {
|
||||||
CommentSortType::Hot => query
|
CommentSortType::Hot => query
|
||||||
.then_order_by(comment_aggregates::hot_rank.desc())
|
.then_order_by(comment_aggregates::hot_rank.desc())
|
||||||
|
|
Loading…
Reference in a new issue