diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-13 12:00:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-13 12:00:13 +0200 |
commit | 367a9dc69975a0db01962dbb7106635fb8eb1696 (patch) | |
tree | edcae09eb37dc50012c66c229a7e0d3fa23a2084 /shared | |
parent | 9f244885f0974730c488233827b63ff0ff08319e (diff) | |
download | PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.gz PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.zst PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.zip |
Don't display remove file icon in some cases
Diffstat (limited to 'shared')
-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 | } |