aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/core-utils/videos/privacy.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/shared/core-utils/videos/privacy.ts b/shared/core-utils/videos/privacy.ts
index 7d3b67d50..f33487b49 100644
--- a/shared/core-utils/videos/privacy.ts
+++ b/shared/core-utils/videos/privacy.ts
@@ -1,9 +1,21 @@
1import { VideoDetails } from '../../models/videos/video.model'
1import { VideoPrivacy } from '../../models/videos/video-privacy.enum' 2import { VideoPrivacy } from '../../models/videos/video-privacy.enum'
2 3
3function getAllPrivacies () { 4function getAllPrivacies () {
4 return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ] 5 return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ]
5} 6}
6 7
8function getAllFiles (video: Partial<Pick<VideoDetails, 'files' | 'streamingPlaylists'>>) {
9 const files = video.files
10
11 if (video.streamingPlaylists[0]) {
12 return files.concat(video.streamingPlaylists[0].files)
13 }
14
15 return files
16}
17
7export { 18export {
8 getAllPrivacies 19 getAllPrivacies,
20 getAllFiles
9} 21}