From 367a9dc69975a0db01962dbb7106635fb8eb1696 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Sep 2022 12:00:13 +0200 Subject: Don't display remove file icon in some cases --- shared/core-utils/videos/privacy.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'shared/core-utils/videos') 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 @@ +import { VideoDetails } from '../../models/videos/video.model' import { VideoPrivacy } from '../../models/videos/video-privacy.enum' function getAllPrivacies () { return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ] } +function getAllFiles (video: Partial>) { + const files = video.files + + if (video.streamingPlaylists[0]) { + return files.concat(video.streamingPlaylists[0].files) + } + + return files +} + export { - getAllPrivacies + getAllPrivacies, + getAllFiles } -- cgit v1.2.3