From: Dessalines Date: Wed, 19 Jun 2019 23:10:05 +0000 (-0700) Subject: Ordering by date second. X-Git-Url: http://these/git/readmes/%7B%60%24%7BwebArchiveUrl%7D/save/static/%7BelementUrl%7D?a=commitdiff_plain;h=8955633a3b3e024ba285ba82060346aa9abe152c;p=lemmy.git Ordering by date second. - Fixes #175 --- diff --git a/server/src/db/comment_view.rs b/server/src/db/comment_view.rs index 9cd61e33..53517db9 100644 --- a/server/src/db/comment_view.rs +++ b/server/src/db/comment_view.rs @@ -94,7 +94,7 @@ impl CommentView { } query = match sort { - // SortType::Hot => query.order_by(hot_rank.desc()), + // SortType::Hot => query.order(hot_rank.desc(), published.desc()), SortType::New => query.order_by(published.desc()), SortType::TopAll => query.order_by(score.desc()), SortType::TopYear => query diff --git a/server/src/db/post_view.rs b/server/src/db/post_view.rs index bfe730a2..bec00b98 100644 --- a/server/src/db/post_view.rs +++ b/server/src/db/post_view.rs @@ -122,7 +122,8 @@ impl PostView { } query = match sort { - SortType::Hot => query.order_by(hot_rank.desc()), + SortType::Hot => query.order_by(hot_rank.desc()) + .then_order_by(published.desc()), SortType::New => query.order_by(published.desc()), SortType::TopAll => query.order_by(score.desc()), SortType::TopYear => query