X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fvideo.ts;h=4fe2a60f0d57ca925bbee339c373cc063919f0a4;hb=2ad9dcda240ee843c5e4a5b98cc94f7b2aab2c89;hp=907564703b7f4a9097b216dd15ef39449da8ff97;hpb=7eba5e1fa81c8e54cb8fe298a96e8070afa50921;p=github%2FChocobozzz%2FPeerTube.git 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 ( if (fetchType === 'id' || fetchType === 'none') return VideoModel.loadOnlyId(id) } -type VideoFetchByUrlType = 'all' | 'only-video' +type VideoFetchByUrlType = 'all' | 'only-video' | 'only-immutable-attributes' function fetchVideoByUrl (url: string, fetchType: 'all'): Bluebird +function fetchVideoByUrl (url: string, fetchType: 'only-immutable-attributes'): Bluebird function fetchVideoByUrl (url: string, fetchType: 'only-video'): Bluebird -function fetchVideoByUrl (url: string, fetchType: VideoFetchByUrlType): Bluebird -function fetchVideoByUrl (url: string, fetchType: VideoFetchByUrlType): Bluebird { +function fetchVideoByUrl ( + url: string, + fetchType: VideoFetchByUrlType +): Bluebird +function fetchVideoByUrl ( + url: string, + fetchType: VideoFetchByUrlType +): Bluebird { if (fetchType === 'all') return VideoModel.loadByUrlAndPopulateAccount(url) + if (fetchType === 'only-immutable-attributes') return VideoModel.loadByUrlImmutableAttributes(url) + if (fetchType === 'only-video') return VideoModel.loadByUrl(url) }