diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-12-19 19:52:55 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-12-19 19:52:55 +0300 |
commit | 5fc84552d311efd606f66775c55862b3d11ad258 (patch) | |
tree | 0ed5f758063757de849321770230591398d83626 | |
parent | 4079d66f00adc665e4c70abad03eab254695e793 (diff) | |
download | pleroma-5fc84552d311efd606f66775c55862b3d11ad258.tar.gz pleroma-5fc84552d311efd606f66775c55862b3d11ad258.zip |
Fix all count
-rw-r--r-- | lib/pleroma/stats.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex index c90e8f409..97e8b1990 100644 --- a/lib/pleroma/stats.ex +++ b/lib/pleroma/stats.ex @@ -82,7 +82,7 @@ defmodule Pleroma.Stats do defp status_count do %{ - all: get_all_statuses_count(), + all: all_statuses_query() |> Repo.aggregate(:count, :id), public: public_statuses_query() |> Repo.aggregate(:count, :id), unlisted: unlisted_statuses_query() |> Repo.aggregate(:count, :id), direct: direct_statuses_query() |> Repo.aggregate(:count, :id), @@ -90,8 +90,8 @@ defmodule Pleroma.Stats do } end - defp get_all_statuses_count do - Repo.aggregate(User.Query.build(%{local: true}), :sum, :note_count) + defp all_statuses_query do + from(o in Object, where: fragment("(?)->>'type' = 'Note'", o.data)) end def public_statuses_query do |