diff options
Diffstat (limited to 'server/lib/model-loaders/video.ts')
-rw-r--r-- | server/lib/model-loaders/video.ts | 10 |
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' |
10 | import { Hooks } from '../plugins/hooks' | 10 | |
11 | 11 | ||
12 | type VideoLoadType = 'for-api' | 'all' | 'only-video' | 'id' | 'none' | 'only-immutable-attributes' | 12 | type 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 | ||