1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Put channel stats behind withStats flag

This commit is contained in:
Rigel Kent 2020-03-24 01:12:30 +01:00 committed by Chocobozzz
parent 8165d00ac6
commit 747c562837
6 changed files with 31 additions and 16 deletions

View file

@ -17,7 +17,8 @@ import {
accountsSortValidator,
ensureAuthUserOwnsAccountValidator,
videoChannelsSortValidator,
videosSortValidator
videosSortValidator,
videoChannelStatsValidator
} from '../../middlewares/validators'
import { AccountModel } from '../../models/account/account'
import { AccountVideoRateModel } from '../../models/account/account-video-rate'
@ -56,6 +57,7 @@ accountsRouter.get('/:accountName/videos',
accountsRouter.get('/:accountName/video-channels',
asyncMiddleware(accountNameWithHostGetValidator),
videoChannelStatsValidator,
paginationValidator,
videoChannelsSortValidator,
setDefaultSort,
@ -116,7 +118,8 @@ async function listAccountChannels (req: express.Request, res: express.Response)
accountId: res.locals.account.id,
start: req.query.start,
count: req.query.count,
sort: req.query.sort
sort: req.query.sort,
withStats: req.query.withStats
}
const resultList = await VideoChannelModel.listByAccount(options)