}
}
+ // ---------------------------------------------------------------------------
+
+ static getEmailOverrideConfig (emailPort: number) {
+ return {
+ smtp: {
+ hostname: '127.0.0.1',
+ port: emailPort
+ }
+ }
+ }
+
+ // ---------------------------------------------------------------------------
+
+ enableSignup (requiresApproval: boolean, limit = -1) {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ signup: {
+ enabled: true,
+ requiresApproval,
+ limit
+ }
+ }
+ })
+ }
+
+ // ---------------------------------------------------------------------------
+
+ disableImports () {
+ return this.setImportsEnabled(false)
+ }
+
enableImports () {
+ return this.setImportsEnabled(true)
+ }
+
+ private setImportsEnabled (enabled: boolean) {
return this.updateExistingSubConfig({
newConfig: {
import: {
videos: {
http: {
- enabled: true
+ enabled
},
torrent: {
- enabled: true
+ enabled
}
}
}
})
}
+ // ---------------------------------------------------------------------------
+
+ enableChannelSync () {
+ return this.setChannelSyncEnabled(true)
+ }
+
+ disableChannelSync () {
+ return this.setChannelSyncEnabled(false)
+ }
+
+ private setChannelSyncEnabled (enabled: boolean) {
+ return this.updateExistingSubConfig({
+ newConfig: {
+ import: {
+ videoChannelSynchronization: {
+ enabled
+ }
+ }
+ }
+ })
+ }
+
+ // ---------------------------------------------------------------------------
+
enableLive (options: {
allowReplay?: boolean
transcoding?: boolean
+ resolutions?: 'min' | 'max' // Default max
} = {}) {
+ const { allowReplay, transcoding, resolutions = 'max' } = options
+
return this.updateExistingSubConfig({
newConfig: {
live: {
enabled: true,
- allowReplay: options.allowReplay ?? true,
+ allowReplay: allowReplay ?? true,
transcoding: {
- enabled: options.transcoding ?? true,
- resolutions: ConfigCommand.getCustomConfigResolutions(true)
+ enabled: transcoding ?? true,
+ resolutions: ConfigCommand.getCustomConfigResolutions(resolutions === 'max')
}
}
}
})
}
+ // ---------------------------------------------------------------------------
+
enableStudio () {
return this.updateExistingSubConfig({
newConfig: {
})
}
+ // ---------------------------------------------------------------------------
+
getConfig (options: OverrideCommandOptions = {}) {
const path = '/api/v1/config'
signup: {
enabled: false,
limit: 5,
+ requiresApproval: true,
requiresEmailVerification: false,
minimumAge: 16
},
'1440p': false,
'2160p': false
},
+ alwaysTranscodeOriginalResolution: true,
webtorrent: {
enabled: true
},
'1080p': true,
'1440p': true,
'2160p': true
- }
+ },
+ alwaysTranscodeOriginalResolution: true
}
},
videoStudio: {
torrent: {
enabled: false
}
+ },
+ videoChannelSynchronization: {
+ enabled: false,
+ maxPerUser: 10
}
},
trending: {