diff options
Diffstat (limited to 'shared/core-utils')
-rw-r--r-- | shared/core-utils/videos/privacy.ts | 14 |
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 @@ | |||
1 | import { VideoDetails } from '../../models/videos/video.model' | ||
1 | import { VideoPrivacy } from '../../models/videos/video-privacy.enum' | 2 | import { VideoPrivacy } from '../../models/videos/video-privacy.enum' |
2 | 3 | ||
3 | function getAllPrivacies () { | 4 | function 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 | ||
8 | function 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 | |||
7 | export { | 18 | export { |
8 | getAllPrivacies | 19 | getAllPrivacies, |
20 | getAllFiles | ||
9 | } | 21 | } |