diff options
Diffstat (limited to 'server/tools/cli.ts')
-rw-r--r-- | server/tools/cli.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/server/tools/cli.ts b/server/tools/cli.ts index 4aa3d9ce8..2eec51aa4 100644 --- a/server/tools/cli.ts +++ b/server/tools/cli.ts | |||
@@ -117,15 +117,22 @@ function buildCommonVideoOptions (command: Command) { | |||
117 | } | 117 | } |
118 | 118 | ||
119 | async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any) { | 119 | async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any) { |
120 | const booleanAttributes: { [id: string]: boolean } = {} | 120 | const defaultBooleanAttributes = { |
121 | nsfw: false, | ||
122 | commentsEnabled: true, | ||
123 | downloadEnabled: true, | ||
124 | waitTranscoding: true | ||
125 | } | ||
126 | |||
127 | const booleanAttributes: { [id in keyof typeof defaultBooleanAttributes]: boolean } | {} = {} | ||
121 | 128 | ||
122 | for (const key of [ 'nsfw', 'commentsEnabled', 'downloadEnabled', 'waitTranscoding' ]) { | 129 | for (const key of Object.keys(defaultBooleanAttributes)) { |
123 | if (command[ key ] !== undefined) { | 130 | if (command[ key ] !== undefined) { |
124 | booleanAttributes[key] = command[ key ] | 131 | booleanAttributes[key] = command[ key ] |
125 | } else if (defaultAttributes[key] !== undefined) { | 132 | } else if (defaultAttributes[key] !== undefined) { |
126 | booleanAttributes[key] = defaultAttributes[key] | 133 | booleanAttributes[key] = defaultAttributes[key] |
127 | } else { | 134 | } else { |
128 | booleanAttributes[key] = false | 135 | booleanAttributes[key] = defaultBooleanAttributes[key] |
129 | } | 136 | } |
130 | } | 137 | } |
131 | 138 | ||