aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-04 14:16:57 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commit68e70a745b2010cd0199864a2addd60d8f99c732 (patch)
treea0b1b061d205321e0f6eb80e5b44d7afd06aab14 /server/helpers/video.ts
parent97969c4edf51b37eee691adba43368bb0fbb729b (diff)
downloadPeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.tar.gz
PeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.tar.zst
PeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.zip
Add save replay live tests
Diffstat (limited to 'server/helpers/video.ts')
-rw-r--r--server/helpers/video.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/helpers/video.ts b/server/helpers/video.ts
index 488b4da17..999137c6d 100644
--- a/server/helpers/video.ts
+++ b/server/helpers/video.ts
@@ -15,7 +15,7 @@ import {
15 MVideoThumbnail, 15 MVideoThumbnail,
16 MVideoWithRights 16 MVideoWithRights
17} from '@server/types/models' 17} from '@server/types/models'
18import { VideoPrivacy, VideoTranscodingPayload } from '@shared/models' 18import { VideoPrivacy, VideoState, VideoTranscodingPayload } from '@shared/models'
19import { VideoModel } from '../models/video/video' 19import { VideoModel } from '../models/video/video'
20 20
21type VideoFetchType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none' | 'only-immutable-attributes' 21type VideoFetchType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none' | 'only-immutable-attributes'
@@ -104,6 +104,13 @@ function isPrivacyForFederation (privacy: VideoPrivacy) {
104 (CONFIG.FEDERATION.VIDEOS.FEDERATE_UNLISTED === true && castedPrivacy === VideoPrivacy.UNLISTED) 104 (CONFIG.FEDERATION.VIDEOS.FEDERATE_UNLISTED === true && castedPrivacy === VideoPrivacy.UNLISTED)
105} 105}
106 106
107function isStateForFederation (state: VideoState) {
108 const castedState = parseInt(state + '', 10)
109
110 return castedState === VideoState.PUBLISHED || castedState === VideoState.WAITING_FOR_LIVE || castedState === VideoState.LIVE_ENDED
111
112}
113
107function getPrivaciesForFederation () { 114function getPrivaciesForFederation () {
108 return (CONFIG.FEDERATION.VIDEOS.FEDERATE_UNLISTED === true) 115 return (CONFIG.FEDERATION.VIDEOS.FEDERATE_UNLISTED === true)
109 ? [ { privacy: VideoPrivacy.PUBLIC }, { privacy: VideoPrivacy.UNLISTED } ] 116 ? [ { privacy: VideoPrivacy.PUBLIC }, { privacy: VideoPrivacy.UNLISTED } ]
@@ -127,6 +134,7 @@ export {
127 addOptimizeOrMergeAudioJob, 134 addOptimizeOrMergeAudioJob,
128 extractVideo, 135 extractVideo,
129 getExtFromMimetype, 136 getExtFromMimetype,
137 isStateForFederation,
130 isPrivacyForFederation, 138 isPrivacyForFederation,
131 getPrivaciesForFederation 139 getPrivaciesForFederation
132} 140}