From 868fce62f86812759ccedccf7634236ac3701d9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Jun 2021 18:10:56 +0200 Subject: fetch -> load avoid confusion with AP fetch functions --- server/lib/model-loaders/video.ts | 45 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'server/lib/model-loaders/video.ts') diff --git a/server/lib/model-loaders/video.ts b/server/lib/model-loaders/video.ts index 7aaf00e89..597c94395 100644 --- a/server/lib/model-loaders/video.ts +++ b/server/lib/model-loaders/video.ts @@ -8,21 +8,21 @@ import { MVideoWithRights } from '@server/types/models' -type VideoFetchType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none' | 'only-immutable-attributes' +type VideoLoadType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none' | 'only-immutable-attributes' -function fetchVideo (id: number | string, fetchType: 'all', userId?: number): Promise -function fetchVideo (id: number | string, fetchType: 'only-immutable-attributes'): Promise -function fetchVideo (id: number | string, fetchType: 'only-video', userId?: number): Promise -function fetchVideo (id: number | string, fetchType: 'only-video-with-rights', userId?: number): Promise -function fetchVideo (id: number | string, fetchType: 'id' | 'none', userId?: number): Promise -function fetchVideo ( +function loadVideo (id: number | string, fetchType: 'all', userId?: number): Promise +function loadVideo (id: number | string, fetchType: 'only-immutable-attributes'): Promise +function loadVideo (id: number | string, fetchType: 'only-video', userId?: number): Promise +function loadVideo (id: number | string, fetchType: 'only-video-with-rights', userId?: number): Promise +function loadVideo (id: number | string, fetchType: 'id' | 'none', userId?: number): Promise +function loadVideo ( id: number | string, - fetchType: VideoFetchType, + fetchType: VideoLoadType, userId?: number ): Promise -function fetchVideo ( +function loadVideo ( id: number | string, - fetchType: VideoFetchType, + fetchType: VideoLoadType, userId?: number ): Promise { if (fetchType === 'all') return VideoModel.loadAndPopulateAccountAndServerAndTags(id, undefined, userId) @@ -36,18 +36,18 @@ function fetchVideo ( if (fetchType === 'id' || fetchType === 'none') return VideoModel.loadOnlyId(id) } -type VideoFetchByUrlType = 'all' | 'only-video' | 'only-immutable-attributes' +type VideoLoadByUrlType = 'all' | 'only-video' | 'only-immutable-attributes' -function fetchVideoByUrl (url: string, fetchType: 'all'): Promise -function fetchVideoByUrl (url: string, fetchType: 'only-immutable-attributes'): Promise -function fetchVideoByUrl (url: string, fetchType: 'only-video'): Promise -function fetchVideoByUrl ( +function loadVideoByUrl (url: string, fetchType: 'all'): Promise +function loadVideoByUrl (url: string, fetchType: 'only-immutable-attributes'): Promise +function loadVideoByUrl (url: string, fetchType: 'only-video'): Promise +function loadVideoByUrl ( url: string, - fetchType: VideoFetchByUrlType + fetchType: VideoLoadByUrlType ): Promise -function fetchVideoByUrl ( +function loadVideoByUrl ( url: string, - fetchType: VideoFetchByUrlType + fetchType: VideoLoadByUrlType ): Promise { if (fetchType === 'all') return VideoModel.loadByUrlAndPopulateAccount(url) @@ -57,8 +57,9 @@ function fetchVideoByUrl ( } export { - VideoFetchType, - VideoFetchByUrlType, - fetchVideo, - fetchVideoByUrl + VideoLoadType, + VideoLoadByUrlType, + + loadVideo, + loadVideoByUrl } -- cgit v1.2.3