diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-11 10:54:05 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-11 11:32:31 +0200 |
commit | 1bcb03a100d172903b877d6a0e4ed11d63b14f3d (patch) | |
tree | 704cf506d2099bbcc0f1db39e95c981ecc21548f /server/lib/config.ts | |
parent | ac2a5b54271e3c3090f863754350907ec916bac2 (diff) | |
download | PeerTube-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.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 | ||