aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/video.ts
diff options
context:
space:
mode:
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}