]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/video-playlist.ts
Fix incorrect error logs
[github/Chocobozzz/PeerTube.git] / server / controllers / api / video-playlist.ts
index 795e14e738a6964f6adcfa6a9a7fe00c6b5c4019..1255d14c67c80aa71ea74679228a81b6d6d9a1af 100644 (file)
@@ -47,7 +47,7 @@ import { AccountModel } from '../../models/account/account'
 import { VideoPlaylistModel } from '../../models/video/video-playlist'
 import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element'
 
-const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })
+const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT)
 
 const videoPlaylistRouter = express.Router()
 
@@ -453,13 +453,19 @@ async function getVideoPlaylistVideos (req: express.Request, res: express.Respon
   const user = res.locals.oauth ? res.locals.oauth.token.User : undefined
   const server = await getServerActor()
 
-  const resultList = await VideoPlaylistElementModel.listForApi({
+  const apiOptions = await Hooks.wrapObject({
     start: req.query.start,
     count: req.query.count,
     videoPlaylistId: videoPlaylistInstance.id,
     serverAccount: server.Account,
     user
-  })
+  }, 'filter:api.video-playlist.videos.list.params')
+
+  const resultList = await Hooks.wrapPromiseFun(
+    VideoPlaylistElementModel.listForApi,
+    apiOptions,
+    'filter:api.video-playlist.videos.list.result'
+  )
 
   const options = {
     displayNSFW: buildNSFWFilter(res, req.query.nsfw),