aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/model-loaders
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-03 11:17:57 +0200
committerChocobozzz <me@florianbigard.com>2022-08-03 11:24:42 +0200
commit0260dc8aca952f9412a8620e433b9e16e675696e (patch)
tree6f3e6dde7242a4f61aff99fd4c35b4e7f5076314 /server/lib/model-loaders
parent9ca0f688e9e8558233f1a538b96a43da44e35353 (diff)
downloadPeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.gz
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.zst
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.zip
Add channel server hooks
Diffstat (limited to 'server/lib/model-loaders')
-rw-r--r--server/lib/model-loaders/video.ts10
1 files changed, 2 insertions, 8 deletions
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 {
7 MVideoImmutable, 7 MVideoImmutable,
8 MVideoThumbnail 8 MVideoThumbnail
9} from '@server/types/models' 9} from '@server/types/models'
10import { Hooks } from '../plugins/hooks' 10
11 11
12type VideoLoadType = 'for-api' | 'all' | 'only-video' | 'id' | 'none' | 'only-immutable-attributes' 12type VideoLoadType = 'for-api' | 'all' | 'only-video' | 'id' | 'none' | 'only-immutable-attributes'
13 13
@@ -27,13 +27,7 @@ function loadVideo (
27 userId?: number 27 userId?: number
28): Promise<MVideoFullLight | MVideoThumbnail | MVideoId | MVideoImmutable> { 28): Promise<MVideoFullLight | MVideoThumbnail | MVideoId | MVideoImmutable> {
29 29
30 if (fetchType === 'for-api') { 30 if (fetchType === 'for-api') return VideoModel.loadForGetAPI({ id, userId })
31 return Hooks.wrapPromiseFun(
32 VideoModel.loadForGetAPI,
33 { id, userId },
34 'filter:api.video.get.result'
35 )
36 }
37 31
38 if (fetchType === 'all') return VideoModel.loadFull(id, undefined, userId) 32 if (fetchType === 'all') return VideoModel.loadFull(id, undefined, userId)
39 33