diff options
author | Dessalines <tyhou13@gmx.com> | 2019-07-03 18:52:17 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-07-03 18:53:44 -0700 |
commit | 49b566716779d194d8e6d42e4005219c62a96d11 (patch) | |
tree | 11246b65288fd8a9ef7d97abb76c070921553c59 /server | |
parent | 8955633a3b3e024ba285ba82060346aa9abe152c (diff) |
Fixing trending sorting.
Diffstat (limited to 'server')
-rw-r--r-- | server/Cargo.toml | 2 | ||||
-rw-r--r-- | server/src/db/community_view.rs | 4 |
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 { |