summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <happydooby@gmail.com>2019-07-03 18:52:17 -0700
committerDessalines <happydooby@gmail.com>2019-07-03 18:53:44 -0700
commit6f6e87fc61bb0fbb6c537af5123a21b60832c6bd (patch)
tree6aa09e231c593b6eb006b37e1e297d25e806cd3d
parentac1f758579d483b889d9c15ac9731bac9cde0496 (diff)
Fixing trending sorting.
-rw-r--r--server/Cargo.toml2
-rw-r--r--server/src/db/community_view.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 58984502..6e14e81a 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -23,3 +23,5 @@ strum_macros = "0.14.0"
jsonwebtoken = "*"
regex = "*"
lazy_static = "*"
+reqwest = "*"
+openssl = { version = "0.10", features = ["vendored"] }
diff --git a/server/src/db/community_view.rs b/server/src/db/community_view.rs
index ec77cc8f..d0dca738 100644
--- a/server/src/db/community_view.rs
+++ b/server/src/db/community_view.rs
@@ -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 {