From: Dessalines Date: Thu, 4 Jul 2019 01:52:17 +0000 (-0700) Subject: Fixing trending sorting. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%24%7Bargs.thread.url%7D?a=commitdiff_plain;h=49b566716779d194d8e6d42e4005219c62a96d11;p=lemmy.git Fixing trending sorting. --- 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 {