diff --git a/backend/src/main/java/io/papermc/hangar/db/dao/internal/HangarStatsDAO.java b/backend/src/main/java/io/papermc/hangar/db/dao/internal/HangarStatsDAO.java index f492c5c9..11fbcdea 100644 --- a/backend/src/main/java/io/papermc/hangar/db/dao/internal/HangarStatsDAO.java +++ b/backend/src/main/java/io/papermc/hangar/db/dao/internal/HangarStatsDAO.java @@ -34,7 +34,11 @@ public interface HangarStatsDAO { SELECT sq.day, sq.project_id, sq.version_id, sq.platform, - count(DISTINCT sq.user_idaddress) FILTER (WHERE sq.processed \\<@ ARRAY[1]) + count(DISTINCT sq.user_id)count(distinct network(case + when family(sq.address::inet) = 6 then set_masklen(sq.address, 48) + when family(sq.address::inet) = 4 then set_masklen(sq.address, 32) + else null end + )::inet) FILTER (WHERE sq.processed \\<@ ARRAY[1]) FROM (SELECT date_trunc('DAY', d.created_at)::date AS day, d.project_id, d.version_id, d.platform,