import { merge } from 'lodash'
+import { About, CustomConfig, HttpStatusCode, ServerConfig } from '@shared/models'
import { DeepPartial } from '@shared/typescript-utils'
-import { About, HttpStatusCode, ServerConfig } from '@shared/models'
-import { CustomConfig } from '../../models/server/custom-config.model'
-import { AbstractCommand, OverrideCommandOptions } from '../shared'
+import { AbstractCommand, OverrideCommandOptions } from '../shared/abstract-command'
export class ConfigCommand extends AbstractCommand {
newConfig: {
transcoding: {
enabled: false
+ },
+ videoEditor: {
+ enabled: false
}
}
})
newConfig: {
transcoding: {
enabled: true,
+
+ allowAudioFiles: true,
+ allowAdditionalExtensions: true,
+
resolutions: ConfigCommand.getCustomConfigResolutions(true),
webtorrent: {
})
}
+ enableMinimumTranscoding (webtorrent = true, hls = true) {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ transcoding: {
+ enabled: true,
+ resolutions: {
+ ...ConfigCommand.getCustomConfigResolutions(false),
+
+ '240p': 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)
+ const existing = await this.getCustomConfig({ ...options, expectedStatus: HttpStatusCode.OK_200 })
return this.updateCustomConfig({ ...options, newCustomConfig: merge({}, existing, options.newConfig) })
}
}
}
},
+ videoEditor: {
+ enabled: false
+ },
import: {
videos: {
concurrency: 3,