]> Untitled Git - lemmy.git/commitdiff
Fixing trending sorting.
authorDessalines <tyhou13@gmx.com>
Thu, 4 Jul 2019 01:52:17 +0000 (18:52 -0700)
committerDessalines <tyhou13@gmx.com>
Thu, 4 Jul 2019 01:53:44 +0000 (18:53 -0700)
server/Cargo.toml
server/src/db/community_view.rs

index 58984502c2170063b7295f61055f98172a742510..6e14e81a29db8a8734952c63a6492f250917cc79 100644 (file)
@@ -23,3 +23,5 @@ strum_macros = "0.14.0"
 jsonwebtoken = "*"
 regex = "*"
 lazy_static = "*"
+reqwest = "*"
+openssl = { version = "0.10", features = ["vendored"] }
index ec77cc8fe83533c5cfa3c5d7d05f5e22ea82e226..d0dca738e80b5b9b6ac79aa53694d2aeb8f75c6a 100644 (file)
@@ -125,7 +125,9 @@ impl CommunityView {
 
     // The view lets you pass a null user_id, if you're not logged in
     match sort {
-      SortType::Hot => query = query.order_by(hot_rank.desc()).filter(user_id.is_null()),
+      SortType::Hot => query = query.order_by(hot_rank.desc())
+        .then_order_by(published.desc())
+        .filter(user_id.is_null()),
       SortType::New => query = query.order_by(published.desc()).filter(user_id.is_null()),
       SortType::TopAll => {
         match from_user_id {