]> Untitled Git - lemmy.git/commitdiff
Ordering by date second.
authorDessalines <tyhou13@gmx.com>
Wed, 19 Jun 2019 23:10:05 +0000 (16:10 -0700)
committerDessalines <tyhou13@gmx.com>
Wed, 19 Jun 2019 23:10:05 +0000 (16:10 -0700)
- Fixes #175

server/src/db/comment_view.rs
server/src/db/post_view.rs

index 9cd61e33e9ad14462dc9a65b40de71093063d8ce..53517db958f0d037a571a015f2d33c8843c27c22 100644 (file)
@@ -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
index bfe730a2b3a9913324d0f5825fef6dfc8cba377b..bec00b982bce0b3b8b640b789d59d46d7da40af8 100644 (file)
@@ -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