X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fcounter_cache.ex;h=1e75d19ae0ef83d12f05ceaf8398d9914e49105b;hb=b98fe4476c13f213f5a4c928b7946516374e133b;hp=b469e7b50846da0fb64d194fd6389c8d36c1be42;hpb=39d2f2118aed7906cb352d8a37f22da73f3a3aa3;p=akkoma
diff --git a/lib/pleroma/counter_cache.ex b/lib/pleroma/counter_cache.ex
index b469e7b50..1e75d19ae 100644
--- a/lib/pleroma/counter_cache.ex
+++ b/lib/pleroma/counter_cache.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.CounterCache do
@@ -40,13 +40,13 @@ defmodule Pleroma.CounterCache do
end
end
- def get_as_map() do
+ def get_sum do
CounterCache
|> select([c], %{
- "public" => sum(c.public),
- "unlisted" => sum(c.unlisted),
- "private" => sum(c.private),
- "direct" => sum(c.direct)
+ "public" => type(sum(c.public), :integer),
+ "unlisted" => type(sum(c.unlisted), :integer),
+ "private" => type(sum(c.private), :integer),
+ "direct" => type(sum(c.direct), :integer)
})
|> Repo.one()
end