]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/comment.ts
Prevent broken transcoding with audio only input
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / comment.ts
index cb696f652cc669b84d9a49798935ac6ceae00b6b..44d64776c60a351232c4ea9b3cf547a2f3c28b81 100644 (file)
@@ -1,4 +1,4 @@
-import * as express from 'express'
+import express from 'express'
 import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models'
 import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
 import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model'
@@ -91,6 +91,7 @@ async function listComments (req: express.Request, res: express.Response) {
     sort: req.query.sort,
 
     isLocal: req.query.isLocal,
+    onLocalVideo: req.query.onLocalVideo,
     search: req.query.search,
     searchAccount: req.query.searchAccount,
     searchVideo: req.query.searchVideo
@@ -192,7 +193,7 @@ async function addVideoCommentThread (req: express.Request, res: express.Respons
   Notifier.Instance.notifyOnNewComment(comment)
   auditLogger.create(getAuditIdFromRes(res), new CommentAuditView(comment.toFormattedJSON()))
 
-  Hooks.runAction('action:api.video-thread.created', { comment })
+  Hooks.runAction('action:api.video-thread.created', { comment, req, res })
 
   return res.json({ comment: comment.toFormattedJSON() })
 }
@@ -214,7 +215,7 @@ async function addVideoCommentReply (req: express.Request, res: express.Response
   Notifier.Instance.notifyOnNewComment(comment)
   auditLogger.create(getAuditIdFromRes(res), new CommentAuditView(comment.toFormattedJSON()))
 
-  Hooks.runAction('action:api.video-comment-reply.created', { comment })
+  Hooks.runAction('action:api.video-comment-reply.created', { comment, req, res })
 
   return res.json({ comment: comment.toFormattedJSON() })
 }
@@ -222,7 +223,7 @@ async function addVideoCommentReply (req: express.Request, res: express.Response
 async function removeVideoComment (req: express.Request, res: express.Response) {
   const videoCommentInstance = res.locals.videoCommentFull
 
-  await removeComment(videoCommentInstance)
+  await removeComment(videoCommentInstance, req, res)
 
   auditLogger.delete(getAuditIdFromRes(res), new CommentAuditView(videoCommentInstance.toFormattedJSON()))