From 74c8d5bf2d807870ed351fb2a0ee7137987aa995 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Jul 2023 16:06:49 +0200 Subject: Refactor enableTranscoding command helpers --- shared/server-commands/server/config-command.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 3521b2d69..5ee2fe021 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts @@ -152,8 +152,13 @@ export class ConfigCommand extends AbstractCommand { }) } - // TODO: convert args to object - enableTranscoding (webVideo = true, hls = true, with0p = false) { + enableTranscoding (options: { + webVideo?: boolean // default true + hls?: boolean // default true + with0p?: boolean // default false + } = {}) { + const { webVideo = true, hls = true, with0p = false } = options + return this.updateExistingSubConfig({ newConfig: { transcoding: { @@ -175,8 +180,12 @@ export class ConfigCommand extends AbstractCommand { }) } - // TODO: convert args to object - enableMinimumTranscoding (webVideo = true, hls = true) { + enableMinimumTranscoding (options: { + webVideo?: boolean // default true + hls?: boolean // default true + } = {}) { + const { webVideo = true, hls = true } = options + return this.updateExistingSubConfig({ newConfig: { transcoding: { -- cgit v1.2.3