From 0260dc8aca952f9412a8620e433b9e16e675696e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Aug 2022 11:17:57 +0200 Subject: Add channel server hooks --- server/lib/model-loaders/video.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'server/lib') diff --git a/server/lib/model-loaders/video.ts b/server/lib/model-loaders/video.ts index cef6a367c..a64389a89 100644 --- a/server/lib/model-loaders/video.ts +++ b/server/lib/model-loaders/video.ts @@ -7,7 +7,7 @@ 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 +27,7 @@ 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.loadFull(id, undefined, userId) -- cgit v1.2.3