ActivityPub-federated video streaming platform using P2P directly in your web browser
Add views tag to middlewares too
Chocobozzz43e186ef44fe
diff --git a/server/core/middlewares/validators/videos/video-view.ts b/server/core/middlewares/validators/videos/video-view.tsindex 4f2c4779b3..ea579095cc 100644--- a/server/core/middlewares/validators/videos/video-view.ts+++ b/server/core/middlewares/validators/videos/video-view.ts@@ -7,18 +7,21 @@ import { body, param } from 'express-validator'import { isIdValid, toIntOrNull } from '../../../helpers/custom-validators/misc.js'import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared/index.js'+const tags = [ 'views' ]+export const getVideoLocalViewerValidator = [param('localViewerId').custom(isIdValid),async (req: express.Request, res: express.Response, next: express.NextFunction) => {- if (areValidationErrors(req, res)) return+ if (areValidationErrors(req, res, { tags })) returnconst localViewer = await LocalVideoViewerModel.loadFullById(+req.params.localViewerId)if (!localViewer) {return res.fail({status: HttpStatusCode.NOT_FOUND_404,- message: 'Local viewer not found'+ message: 'Local viewer not found',+ tags})}@@ -36,7 +39,7 @@ export const videoViewValidator = [.isInt(),async (req: express.Request, res: express.Response, next: express.NextFunction) => {- if (areValidationErrors(req, res)) return+ if (areValidationErrors(req, res, { tags })) returnif (!await doesVideoExist(req.params.videoId, res, 'unsafe-only-immutable-attributes')) returnconst video = res.locals.onlyImmutableVideo@@ -47,7 +50,8 @@ export const videoViewValidator = [return res.fail({status: HttpStatusCode.BAD_REQUEST_400,message: `Current time ${currentTime} is invalid (video ${video.uuid} duration: ${duration})`,- logLevel: 'warn'+ logLevel: 'warn',+ tags})}