]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/model-loaders/video.ts
Use bullmq job dependency
[github/Chocobozzz/PeerTube.git] / server / lib / model-loaders / video.ts
index cef6a367c1c05e960cdeac0db4bd9a7a72facadd..91057d40591a2dd2c7518e9488ec5c4db4e84441 100644 (file)
@@ -7,7 +7,6 @@ import {
   MVideoImmutable,
   MVideoThumbnail
 } from '@server/types/models'
-import { Hooks } from '../plugins/hooks'
 
 type VideoLoadType = 'for-api' | 'all' | 'only-video' | 'id' | 'none' | 'only-immutable-attributes'
 
@@ -27,13 +26,7 @@ function loadVideo (
   userId?: number
 ): Promise<MVideoFullLight | MVideoThumbnail | MVideoId | MVideoImmutable> {
 
-  if (fetchType === 'for-api') {
-    return Hooks.wrapPromiseFun(
-      VideoModel.loadForGetAPI,
-      { id, userId },
-      'filter:api.video.get.result'
-    )
-  }
+  if (fetchType === 'for-api') return VideoModel.loadForGetAPI({ id, userId })
 
   if (fetchType === 'all') return VideoModel.loadFull(id, undefined, userId)