diff options
Diffstat (limited to 'server/lib/config.ts')
-rw-r--r-- | server/lib/config.ts | 12 |
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 | |||
6 | import { Hooks } from './plugins/hooks' | 6 | import { Hooks } from './plugins/hooks' |
7 | import { PluginManager } from './plugins/plugin-manager' | 7 | import { PluginManager } from './plugins/plugin-manager' |
8 | import { getThemeOrDefault } from './plugins/theme-utils' | 8 | import { getThemeOrDefault } from './plugins/theme-utils' |
9 | import { getEnabledResolutions } from './video-transcoding' | ||
10 | import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' | 9 | import { VideoTranscodingProfilesManager } from './video-transcoding-profiles' |
11 | 10 | ||
12 | let serverCommit: string | 11 | let serverCommit: string |
@@ -208,11 +207,22 @@ function getRegisteredPlugins () { | |||
208 | })) | 207 | })) |
209 | } | 208 | } |
210 | 209 | ||
210 | function 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 | ||
213 | export { | 222 | export { |
214 | getServerConfig, | 223 | getServerConfig, |
215 | getRegisteredThemes, | 224 | getRegisteredThemes, |
225 | getEnabledResolutions, | ||
216 | getRegisteredPlugins | 226 | getRegisteredPlugins |
217 | } | 227 | } |
218 | 228 | ||