]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/config.ts
Add audio-only option to transcoders and player
[github/Chocobozzz/PeerTube.git] / server / controllers / api / config.ts
index 113c1e9dba8f1af4d96253c5775c0524622eb397..8a00f9835a319c834fe2419206c9c5d451f641dc 100644 (file)
@@ -95,6 +95,9 @@ async function getConfig (req: express.Request, res: express.Response) {
       hls: {
         enabled: CONFIG.TRANSCODING.HLS.ENABLED
       },
+      webtorrent: {
+        enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
+      },
       enabledResolutions: getEnabledResolutions()
     },
     import: {
@@ -297,6 +300,7 @@ function customConfig (): CustomConfig {
       allowAudioFiles: CONFIG.TRANSCODING.ALLOW_AUDIO_FILES,
       threads: CONFIG.TRANSCODING.THREADS,
       resolutions: {
+        '0p': CONFIG.TRANSCODING.RESOLUTIONS[ '0p' ],
         '240p': CONFIG.TRANSCODING.RESOLUTIONS[ '240p' ],
         '360p': CONFIG.TRANSCODING.RESOLUTIONS[ '360p' ],
         '480p': CONFIG.TRANSCODING.RESOLUTIONS[ '480p' ],
@@ -304,6 +308,9 @@ function customConfig (): CustomConfig {
         '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ],
         '2160p': CONFIG.TRANSCODING.RESOLUTIONS[ '2160p' ]
       },
+      webtorrent: {
+        enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED
+      },
       hls: {
         enabled: CONFIG.TRANSCODING.HLS.ENABLED
       }
@@ -350,6 +357,7 @@ function convertCustomConfigBody (body: CustomConfig) {
   function keyConverter (k: string) {
     // Transcoding resolutions exception
     if (/^\d{3,4}p$/.exec(k)) return k
+    if (/^0p$/.exec(k)) return k
 
     return snakeCase(k)
   }