aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-12 16:09:02 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-10-24 14:48:24 +0200
commit3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (patch)
treee7f1d12ef5dae1e1142c3a8d0b681c1dbbb0de10 /client/src/root-helpers/video.ts
parent38a3ccc7f8ad0ea94362b58c732af7c387ab46be (diff)
downloadPeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.gz
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.tar.zst
PeerTube-3545e72c686ff1725bbdfd8d16d693e2f4aa75a3.zip
Put private videos under a specific subdirectory
Diffstat (limited to 'client/src/root-helpers/video.ts')
-rw-r--r--client/src/root-helpers/video.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/root-helpers/video.ts b/client/src/root-helpers/video.ts
index ba84e49ea..107ba1eba 100644
--- a/client/src/root-helpers/video.ts
+++ b/client/src/root-helpers/video.ts
@@ -1,4 +1,4 @@
1import { HTMLServerConfig, Video } from '@shared/models' 1import { HTMLServerConfig, Video, VideoPrivacy } from '@shared/models'
2 2
3function buildVideoOrPlaylistEmbed (options: { 3function buildVideoOrPlaylistEmbed (options: {
4 embedUrl: string 4 embedUrl: string
@@ -26,9 +26,14 @@ function isP2PEnabled (video: Video, config: HTMLServerConfig, userP2PEnabled: b
26 return userP2PEnabled 26 return userP2PEnabled
27} 27}
28 28
29function videoRequiresAuth (video: Video) {
30 return new Set([ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]).has(video.privacy.id)
31}
32
29export { 33export {
30 buildVideoOrPlaylistEmbed, 34 buildVideoOrPlaylistEmbed,
31 isP2PEnabled 35 isP2PEnabled,
36 videoRequiresAuth
32} 37}
33 38
34// --------------------------------------------------------------------------- 39// ---------------------------------------------------------------------------