diff options
author | lambda <pleromagit@rogerbraun.net> | 2019-01-16 08:59:40 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2019-01-16 08:59:40 +0000 |
commit | da4b670451fcc41b960aeb33adb9f0184ba599cf (patch) | |
tree | fe67bee8d9af393c8f76912c221db3eb660ef37e /lib | |
parent | 9a444c0d22fc935c0e268c10d32c847125fd3627 (diff) | |
parent | 90433b988e4d9519e0d2368452aefdb0dc565b52 (diff) | |
download | pleroma-da4b670451fcc41b960aeb33adb9f0184ba599cf.tar.gz |
Merge branch '518_instance_stats_fix' into 'develop'
[#518] Fix: /api/v1/instance ("domain_count"), /api/v1/instance/peers
Closes #518
See merge request pleroma/pleroma!673
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/stats.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex index 8a030ecd0..65a6d58b5 100644 --- a/lib/pleroma/stats.ex +++ b/lib/pleroma/stats.ex @@ -34,10 +34,11 @@ defmodule Pleroma.Stats do peers = from( u in Pleroma.User, - select: fragment("distinct ?->'host'", u.info), + select: fragment("distinct split_part(?, '@', 2)", u.nickname), where: u.local != ^true ) |> Repo.all() + |> Enum.filter(& &1) domain_count = Enum.count(peers) |