diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
commit | 74dc3bca2b14f5fd3fe80c394dfc34177a46db77 (patch) | |
tree | e4b307beb6255420c9993a2aed470438317f100f /server/initializers/constants.ts | |
parent | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (diff) | |
download | PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.gz PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.zst PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.zip |
Don't expose constants directly in initializers/
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 3922d8515..a0609d7cd 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -341,7 +341,7 @@ const VIDEO_LICENCES = { | |||
341 | 7: 'Public Domain Dedication' | 341 | 7: 'Public Domain Dedication' |
342 | } | 342 | } |
343 | 343 | ||
344 | const VIDEO_LANGUAGES = buildLanguages() | 344 | let VIDEO_LANGUAGES: { [id: string]: string } = {} |
345 | 345 | ||
346 | const VIDEO_PRIVACIES = { | 346 | const VIDEO_PRIVACIES = { |
347 | [ VideoPrivacy.PUBLIC ]: 'Public', | 347 | [ VideoPrivacy.PUBLIC ]: 'Public', |
@@ -684,6 +684,7 @@ export { | |||
684 | VIDEO_VIEW_LIFETIME, | 684 | VIDEO_VIEW_LIFETIME, |
685 | CONTACT_FORM_LIFETIME, | 685 | CONTACT_FORM_LIFETIME, |
686 | VIDEO_PLAYLIST_PRIVACIES, | 686 | VIDEO_PLAYLIST_PRIVACIES, |
687 | loadLanguages, | ||
687 | buildLanguages | 688 | buildLanguages |
688 | } | 689 | } |
689 | 690 | ||
@@ -732,6 +733,10 @@ function buildVideosExtname () { | |||
732 | : [ '.mp4', '.ogv', '.webm' ] | 733 | : [ '.mp4', '.ogv', '.webm' ] |
733 | } | 734 | } |
734 | 735 | ||
736 | function loadLanguages () { | ||
737 | VIDEO_LANGUAGES = buildLanguages() | ||
738 | } | ||
739 | |||
735 | function buildLanguages () { | 740 | function buildLanguages () { |
736 | const iso639 = require('iso-639-3') | 741 | const iso639 = require('iso-639-3') |
737 | 742 | ||