aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/config.ts')
-rw-r--r--server/lib/config.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/lib/config.ts b/server/lib/config.ts
index b4c4c9299..eb4510680 100644
--- a/server/lib/config.ts
+++ b/server/lib/config.ts
@@ -6,7 +6,6 @@ import { RegisteredExternalAuthConfig, RegisteredIdAndPassAuthConfig, ServerConf
6import { Hooks } from './plugins/hooks' 6import { Hooks } from './plugins/hooks'
7import { PluginManager } from './plugins/plugin-manager' 7import { PluginManager } from './plugins/plugin-manager'
8import { getThemeOrDefault } from './plugins/theme-utils' 8import { getThemeOrDefault } from './plugins/theme-utils'
9import { getEnabledResolutions } from './video-transcoding'
10import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' 9import { VideoTranscodingProfilesManager } from './video-transcoding-profiles'
11 10
12let serverCommit: string 11let serverCommit: string
@@ -208,11 +207,22 @@ function getRegisteredPlugins () {
208 })) 207 }))
209} 208}
210 209
210function getEnabledResolutions (type: 'vod' | 'live') {
211 const transcoding = type === 'vod'
212 ? CONFIG.TRANSCODING
213 : CONFIG.LIVE.TRANSCODING
214
215 return Object.keys(transcoding.RESOLUTIONS)
216 .filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true)
217 .map(r => parseInt(r, 10))
218}
219
211// --------------------------------------------------------------------------- 220// ---------------------------------------------------------------------------
212 221
213export { 222export {
214 getServerConfig, 223 getServerConfig,
215 getRegisteredThemes, 224 getRegisteredThemes,
225 getEnabledResolutions,
216 getRegisteredPlugins 226 getRegisteredPlugins
217} 227}
218 228