ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove unnecessary code
Chocobozzzf1c70a8666e5
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.tsindex 96d956035b..698afdbd11 100644--- a/server/middlewares/validators/videos/video-comments.ts+++ b/server/middlewares/validators/videos/video-comments.ts@@ -91,12 +91,7 @@ const addVideoCommentThreadValidator = [if (areValidationErrors(req, res)) returnif (!await doesVideoExist(req.params.videoId, res)) return- if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) {- return res.fail({- status: HttpStatusCode.FORBIDDEN_403,- message: 'Cannot access to this ressource'- })- }+ if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) returnif (!isVideoCommentsEnabled(res.locals.videoAll, res)) returnif (!await isVideoCommentAccepted(req, res, res.locals.videoAll, false)) return@@ -118,12 +113,7 @@ const addVideoCommentReplyValidator = [if (areValidationErrors(req, res)) returnif (!await doesVideoExist(req.params.videoId, res)) return- if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) {- return res.fail({- status: HttpStatusCode.FORBIDDEN_403,- message: 'Cannot access to this ressource'- })- }+ if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) returnif (!isVideoCommentsEnabled(res.locals.videoAll, res)) returnif (!await doesVideoCommentExist(req.params.commentId, res.locals.videoAll, res)) returndiff --git a/server/middlewares/validators/videos/video-rates.ts b/server/middlewares/validators/videos/video-rates.tsindex 923bf3eaf9..1a97360346 100644--- a/server/middlewares/validators/videos/video-rates.ts+++ b/server/middlewares/validators/videos/video-rates.ts@@ -21,12 +21,7 @@ const videoUpdateRateValidator = [if (areValidationErrors(req, res)) returnif (!await doesVideoExist(req.params.id, res)) return- if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) {- return res.fail({- status: HttpStatusCode.FORBIDDEN_403,- message: 'Cannot access to this ressource'- })- }+ if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) returnreturn next()}