X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fmodel-loaders%2Fvideo.ts;h=91057d40591a2dd2c7518e9488ec5c4db4e84441;hb=bd911b54b555b11df7e9849cf92d358bccfecf6e;hp=0a3c15ad83ac326cd60ae0b6abbc243225944046;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/model-loaders/video.ts b/server/lib/model-loaders/video.ts index 0a3c15ad8..91057d405 100644 --- a/server/lib/model-loaders/video.ts +++ b/server/lib/model-loaders/video.ts @@ -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 { - 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)