aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-19 10:43:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-10-24 14:48:24 +0200
commit9ab330b90decf4edf152ff8e1d2948c065766b2c (patch)
tree29d924f50f7307e8e828a57ecb9ea78623487ce0 /shared/core-utils/videos
parent3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (diff)
downloadPeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.gz
PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.zst
PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.zip
Use private ACL for private videos in s3
Diffstat (limited to 'shared/core-utils/videos')
-rw-r--r--shared/core-utils/videos/common.ts (renamed from shared/core-utils/videos/privacy.ts)15
-rw-r--r--shared/core-utils/videos/index.ts2
2 files changed, 11 insertions, 6 deletions
diff --git a/shared/core-utils/videos/privacy.ts b/shared/core-utils/videos/common.ts
index f33487b49..2c6efdb7f 100644
--- a/shared/core-utils/videos/privacy.ts
+++ b/shared/core-utils/videos/common.ts
@@ -1,5 +1,6 @@
1import { VideoDetails } from '../../models/videos/video.model' 1import { VideoStreamingPlaylistType } from '@shared/models'
2import { VideoPrivacy } from '../../models/videos/video-privacy.enum' 2import { VideoPrivacy } from '../../models/videos/video-privacy.enum'
3import { VideoDetails } from '../../models/videos/video.model'
3 4
4function getAllPrivacies () { 5function getAllPrivacies () {
5 return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ] 6 return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ]
@@ -8,14 +9,18 @@ function getAllPrivacies () {
8function getAllFiles (video: Partial<Pick<VideoDetails, 'files' | 'streamingPlaylists'>>) { 9function getAllFiles (video: Partial<Pick<VideoDetails, 'files' | 'streamingPlaylists'>>) {
9 const files = video.files 10 const files = video.files
10 11
11 if (video.streamingPlaylists[0]) { 12 const hls = getHLS(video)
12 return files.concat(video.streamingPlaylists[0].files) 13 if (hls) return files.concat(hls.files)
13 }
14 14
15 return files 15 return files
16} 16}
17 17
18function getHLS (video: Partial<Pick<VideoDetails, 'streamingPlaylists'>>) {
19 return video.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS)
20}
21
18export { 22export {
19 getAllPrivacies, 23 getAllPrivacies,
20 getAllFiles 24 getAllFiles,
25 getHLS
21} 26}
diff --git a/shared/core-utils/videos/index.ts b/shared/core-utils/videos/index.ts
index 620e3a716..2cf319395 100644
--- a/shared/core-utils/videos/index.ts
+++ b/shared/core-utils/videos/index.ts
@@ -1,2 +1,2 @@
1export * from './bitrate' 1export * from './bitrate'
2export * from './privacy' 2export * from './common'