aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-30 11:41:36 +0100
committerChocobozzz <me@florianbigard.com>2020-12-30 11:41:36 +0100
commit47d8e266f16b91fec7e4a15a8372d50c2909c042 (patch)
tree41902b4ff8dfc73dfd69f064a2e343a34c43ab97 /server/controllers/static.ts
parenta046453549bf8f2ced083cc8ac414a9cab42dcf5 (diff)
downloadPeerTube-47d8e266f16b91fec7e4a15a8372d50c2909c042.tar.gz
PeerTube-47d8e266f16b91fec7e4a15a8372d50c2909c042.tar.zst
PeerTube-47d8e266f16b91fec7e4a15a8372d50c2909c042.zip
Support activeMonth and activeHalfyear in nodeinfo
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index f12f00e1b..bdb9c3041 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -206,7 +206,7 @@ export {
206async function generateNodeinfo (req: express.Request, res: express.Response) { 206async function generateNodeinfo (req: express.Request, res: express.Response) {
207 const { totalVideos } = await VideoModel.getStats() 207 const { totalVideos } = await VideoModel.getStats()
208 const { totalLocalVideoComments } = await VideoCommentModel.getStats() 208 const { totalLocalVideoComments } = await VideoCommentModel.getStats()
209 const { totalUsers } = await UserModel.getStats() 209 const { totalUsers, totalMonthlyActiveUsers, totalHalfYearActiveUsers } = await UserModel.getStats()
210 let json = {} 210 let json = {}
211 211
212 if (req.params.version && (req.params.version === '2.0')) { 212 if (req.params.version && (req.params.version === '2.0')) {
@@ -229,7 +229,9 @@ async function generateNodeinfo (req: express.Request, res: express.Response) {
229 openRegistrations: CONFIG.SIGNUP.ENABLED, 229 openRegistrations: CONFIG.SIGNUP.ENABLED,
230 usage: { 230 usage: {
231 users: { 231 users: {
232 total: totalUsers 232 total: totalUsers,
233 activeMonth: totalMonthlyActiveUsers,
234 activeHalfyear: totalHalfYearActiveUsers
233 }, 235 },
234 localPosts: totalVideos, 236 localPosts: totalVideos,
235 localComments: totalLocalVideoComments 237 localComments: totalLocalVideoComments