static getCustomConfigResolutions (enabled: boolean) {
return {
+ '144p': enabled,
'240p': enabled,
'360p': enabled,
'480p': enabled,
}
}
+ enableImports () {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ import: {
+ videos: {
+ http: {
+ enabled: true
+ },
+
+ torrent: {
+ enabled: true
+ }
+ }
+ }
+ }
+ })
+ }
+
+ enableLive (options: {
+ allowReplay?: boolean
+ transcoding?: boolean
+ } = {}) {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ live: {
+ enabled: true,
+ allowReplay: options.allowReplay ?? true,
+ transcoding: {
+ enabled: options.transcoding ?? true,
+ resolutions: ConfigCommand.getCustomConfigResolutions(true)
+ }
+ }
+ }
+ })
+ }
+
+ disableTranscoding () {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ transcoding: {
+ enabled: false
+ }
+ }
+ })
+ }
+
+ enableTranscoding (webtorrent = true, hls = true) {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ transcoding: {
+ enabled: true,
+ resolutions: ConfigCommand.getCustomConfigResolutions(true),
+
+ webtorrent: {
+ enabled: webtorrent
+ },
+ hls: {
+ enabled: hls
+ }
+ }
+ }
+ })
+ }
+
getConfig (options: OverrideCommandOptions = {}) {
const path = '/api/v1/config'
})
}
+ async updateExistingSubConfig (options: OverrideCommandOptions & {
+ newConfig: DeepPartial<CustomConfig>
+ }) {
+ const existing = await this.getCustomConfig(options)
+
+ return this.updateCustomConfig({ ...options, newCustomConfig: merge({}, existing, options.newConfig) })
+ }
+
updateCustomSubConfig (options: OverrideCommandOptions & {
newConfig: DeepPartial<CustomConfig>
}) {
whitelisted: true
}
},
+ client: {
+ videos: {
+ miniature: {
+ preferAuthorDisplayName: false
+ }
+ },
+ menu: {
+ login: {
+ redirectOnSingleExternalAuth: false
+ }
+ }
+ },
cache: {
previews: {
size: 2
videoQuota: 5242881,
videoQuotaDaily: 318742
},
+ videoChannels: {
+ maxPerUser: 20
+ },
transcoding: {
enabled: true,
allowAdditionalExtensions: true,
profile: 'default',
resolutions: {
'0p': false,
+ '144p': false,
'240p': false,
'360p': true,
'480p': true,
threads: 4,
profile: 'default',
resolutions: {
+ '144p': true,
'240p': true,
'360p': true,
'480p': true,