X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_views%2Fsrc%2Fpost_view.rs;h=d1e974d8a107290211abbfb034bcde694116ede6;hb=f5209fffc1de527db7ea007d463c158b36fda515;hp=14cf7fe1976e3832b2515d60839de9708997d339;hpb=50efb1d519c63a7007a07f11cc8a11487703c70d;p=lemmy.git diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 14cf7fe1..d1e974d8 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -430,6 +430,18 @@ impl<'a> PostQuery<'a> { .filter(post_aggregates::published.gt(now - 12.hours())) .then_order_by(post_aggregates::score.desc()) .then_order_by(post_aggregates::published.desc()), + SortType::TopThreeMonths => query + .filter(post_aggregates::published.gt(now - 3.months())) + .then_order_by(post_aggregates::score.desc()) + .then_order_by(post_aggregates::published.desc()), + SortType::TopSixMonths => query + .filter(post_aggregates::published.gt(now - 6.months())) + .then_order_by(post_aggregates::score.desc()) + .then_order_by(post_aggregates::published.desc()), + SortType::TopNineMonths => query + .filter(post_aggregates::published.gt(now - 9.months())) + .then_order_by(post_aggregates::score.desc()) + .then_order_by(post_aggregates::published.desc()), }; let (limit, offset) = limit_and_offset(self.page, self.limit)?;