diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/video.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/server/helpers/video.ts b/server/helpers/video.ts index 907564703..4fe2a60f0 100644 --- a/server/helpers/video.ts +++ b/server/helpers/video.ts | |||
@@ -38,14 +38,23 @@ function fetchVideo ( | |||
38 | if (fetchType === 'id' || fetchType === 'none') return VideoModel.loadOnlyId(id) | 38 | if (fetchType === 'id' || fetchType === 'none') return VideoModel.loadOnlyId(id) |
39 | } | 39 | } |
40 | 40 | ||
41 | type VideoFetchByUrlType = 'all' | 'only-video' | 41 | type VideoFetchByUrlType = 'all' | 'only-video' | 'only-immutable-attributes' |
42 | 42 | ||
43 | function fetchVideoByUrl (url: string, fetchType: 'all'): Bluebird<MVideoAccountLightBlacklistAllFiles> | 43 | function fetchVideoByUrl (url: string, fetchType: 'all'): Bluebird<MVideoAccountLightBlacklistAllFiles> |
44 | function fetchVideoByUrl (url: string, fetchType: 'only-immutable-attributes'): Bluebird<MVideoImmutable> | ||
44 | function fetchVideoByUrl (url: string, fetchType: 'only-video'): Bluebird<MVideoThumbnail> | 45 | function fetchVideoByUrl (url: string, fetchType: 'only-video'): Bluebird<MVideoThumbnail> |
45 | function fetchVideoByUrl (url: string, fetchType: VideoFetchByUrlType): Bluebird<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail> | 46 | function fetchVideoByUrl ( |
46 | function fetchVideoByUrl (url: string, fetchType: VideoFetchByUrlType): Bluebird<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail> { | 47 | url: string, |
48 | fetchType: VideoFetchByUrlType | ||
49 | ): Bluebird<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> | ||
50 | function fetchVideoByUrl ( | ||
51 | url: string, | ||
52 | fetchType: VideoFetchByUrlType | ||
53 | ): Bluebird<MVideoAccountLightBlacklistAllFiles | MVideoThumbnail | MVideoImmutable> { | ||
47 | if (fetchType === 'all') return VideoModel.loadByUrlAndPopulateAccount(url) | 54 | if (fetchType === 'all') return VideoModel.loadByUrlAndPopulateAccount(url) |
48 | 55 | ||
56 | if (fetchType === 'only-immutable-attributes') return VideoModel.loadByUrlImmutableAttributes(url) | ||
57 | |||
49 | if (fetchType === 'only-video') return VideoModel.loadByUrl(url) | 58 | if (fetchType === 'only-video') return VideoModel.loadByUrl(url) |
50 | } | 59 | } |
51 | 60 | ||