diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-12 16:09:02 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-10-24 14:48:24 +0200 |
commit | 3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (patch) | |
tree | e7f1d12ef5dae1e1142c3a8d0b681c1dbbb0de10 /client/src/root-helpers/video.ts | |
parent | 38a3ccc7f8ad0ea94362b58c732af7c387ab46be (diff) | |
download | PeerTube-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.ts | 9 |
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 @@ | |||
1 | import { HTMLServerConfig, Video } from '@shared/models' | 1 | import { HTMLServerConfig, Video, VideoPrivacy } from '@shared/models' |
2 | 2 | ||
3 | function buildVideoOrPlaylistEmbed (options: { | 3 | function 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 | ||
29 | function videoRequiresAuth (video: Video) { | ||
30 | return new Set([ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]).has(video.privacy.id) | ||
31 | } | ||
32 | |||
29 | export { | 33 | export { |
30 | buildVideoOrPlaylistEmbed, | 34 | buildVideoOrPlaylistEmbed, |
31 | isP2PEnabled | 35 | isP2PEnabled, |
36 | videoRequiresAuth | ||
32 | } | 37 | } |
33 | 38 | ||
34 | // --------------------------------------------------------------------------- | 39 | // --------------------------------------------------------------------------- |