aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-13 12:00:13 +0200
committerChocobozzz <me@florianbigard.com>2022-09-13 12:00:13 +0200
commit367a9dc69975a0db01962dbb7106635fb8eb1696 (patch)
treeedcae09eb37dc50012c66c229a7e0d3fa23a2084 /shared/core-utils
parent9f244885f0974730c488233827b63ff0ff08319e (diff)
downloadPeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.gz
PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.zst
PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.zip
Don't display remove file icon in some cases
Diffstat (limited to 'shared/core-utils')
-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}