]> 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 0a3c15ad83ac326cd60ae0b6abbc243225944046..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,15 +26,9 @@ 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.loadAndPopulateAccountAndServerAndTags(id, undefined, userId)
+  if (fetchType === 'all') return VideoModel.loadFull(id, undefined, userId)
 
   if (fetchType === 'only-immutable-attributes') return VideoModel.loadImmutableAttributes(id)