aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/config.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-11 10:54:05 +0200
committerChocobozzz <me@florianbigard.com>2021-05-11 11:32:31 +0200
commit1bcb03a100d172903b877d6a0e4ed11d63b14f3d (patch)
tree704cf506d2099bbcc0f1db39e95c981ecc21548f /server/lib/config.ts
parentac2a5b54271e3c3090f863754350907ec916bac2 (diff)
downloadPeerTube-1bcb03a100d172903b877d6a0e4ed11d63b14f3d.tar.gz
PeerTube-1bcb03a100d172903b877d6a0e4ed11d63b14f3d.tar.zst
PeerTube-1bcb03a100d172903b877d6a0e4ed11d63b14f3d.zip
Use a class for youtube-dl
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