From d0c1ff3603a7b139cf4d8319adc808e8cabc054f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 13 Nov 2019 15:19:43 +0000 Subject: [PATCH] Metadata for monthly active accounts --- metadata.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/metadata.py b/metadata.py index 3b213a49d..0833abdc6 100644 --- a/metadata.py +++ b/metadata.py @@ -10,11 +10,14 @@ import os import json import commentjson from utils import noOfAccounts +from utils import noOfActiveAccountsMonthly def metaDataNodeInfo(baseDir: str,registration: bool,version: str) -> {}: """ /nodeinfo/2.0 endpoint """ activeAccounts=noOfAccounts(baseDir) + activeAccountsMonthly=noOfActiveAccountsMonthly(baseDir,1) + activeAccountsHalfYear=noOfActiveAccountsMonthly(baseDir,6) nodeinfo = { 'openRegistrations': registration, 'protocols': ['activitypub'], @@ -25,8 +28,8 @@ def metaDataNodeInfo(baseDir: str,registration: bool,version: str) -> {}: 'usage': { 'localPosts': 1, 'users': { - 'activeHalfyear': 1, - 'activeMonth': 1, + 'activeHalfyear': activeAccountsHalfYear, + 'activeMonth': activeAccountsMonthly, 'total': activeAccounts } },