From 44b9c0ba31c4a97e3d874f33226ad935c3a90dd5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 Jan 2019 09:45:54 +0100 Subject: Add totalLocalVideoFilesSize in stats --- server/controllers/api/server/stats.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/server/stats.ts b/server/controllers/api/server/stats.ts index 85803f69e..89ffd1717 100644 --- a/server/controllers/api/server/stats.ts +++ b/server/controllers/api/server/stats.ts @@ -8,6 +8,7 @@ import { VideoCommentModel } from '../../../models/video/video-comment' import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' import { CONFIG, ROUTE_CACHE_LIFETIME } from '../../../initializers/constants' import { cacheRoute } from '../../../middlewares/cache' +import { VideoFileModel } from '../../../models/video/video-file' const statsRouter = express.Router() @@ -16,11 +17,12 @@ statsRouter.get('/stats', asyncMiddleware(getStats) ) -async function getStats (req: express.Request, res: express.Response, next: express.NextFunction) { +async function getStats (req: express.Request, res: express.Response) { const { totalLocalVideos, totalLocalVideoViews, totalVideos } = await VideoModel.getStats() const { totalLocalVideoComments, totalVideoComments } = await VideoCommentModel.getStats() const { totalUsers } = await UserModel.getStats() const { totalInstanceFollowers, totalInstanceFollowing } = await ActorFollowModel.getStats() + const { totalLocalVideoFilesSize } = await VideoFileModel.getStats() const videosRedundancyStats = await Promise.all( CONFIG.REDUNDANCY.VIDEOS.STRATEGIES.map(r => { @@ -32,8 +34,9 @@ async function getStats (req: express.Request, res: express.Response, next: expr const data: ServerStats = { totalLocalVideos, totalLocalVideoViews, - totalVideos, + totalLocalVideoFilesSize, totalLocalVideoComments, + totalVideos, totalVideoComments, totalUsers, totalInstanceFollowers, -- cgit v1.2.3