Browse Source

CLI - adjustments for updateVideo, updateChannel, createChannel

Leszek Wiesner 4 years ago
parent
commit
6badc4a55c

+ 1 - 1
cli/src/commands/media/createChannel.ts

@@ -27,7 +27,7 @@ export default class CreateChannelCommand extends ContentDirectoryCommandBase {
     if (!inputJson) {
       const customPrompts: JsonSchemaCustomPrompts = [
         ['language', () => this.promptForEntityId('Choose channel language', 'Language', 'name')],
-        ['curationStatus', async () => undefined],
+        ['isCensored', async () => undefined],
       ]
 
       const prompter = new JsonSchemaPrompter<ChannelEntity>(channelJsonSchema, undefined, customPrompts)

+ 6 - 2
cli/src/commands/media/updateChannel.ts

@@ -65,15 +65,19 @@ export default class UpdateChannelCommand extends ContentDirectoryCommandBase {
 
     let inputJson = await getInputJson<ChannelEntity>(input, channelJsonSchema)
     if (!inputJson) {
-      const customPrompts: JsonSchemaCustomPrompts = [
+      const customPrompts: JsonSchemaCustomPrompts<ChannelEntity> = [
         [
           'language',
           () =>
             this.promptForEntityId('Choose channel language', 'Language', 'name', undefined, currentValues.language),
         ],
-        ['curationStatus', async () => undefined],
       ]
 
+      if (!asCurator) {
+        // Skip isCensored is it's not updated by the curator
+        customPrompts.push(['isCensored', async () => undefined])
+      }
+
       const prompter = new JsonSchemaPrompter<ChannelEntity>(channelJsonSchema, currentValues, customPrompts)
 
       inputJson = await prompter.promptAll()

+ 4 - 0
cli/src/commands/media/updateVideo.ts

@@ -96,6 +96,10 @@ export default class UpdateVideoCommand extends ContentDirectoryCommandBase {
       'hasMarketing',
     ])
 
+    if (asCurator) {
+      updatedProps.isCensored = await videoPrompter.promptSingleProp('isCensored')
+    }
+
     this.jsonPrettyPrint(JSON.stringify(updatedProps))
 
     // Parse inputs into operations and send final extrinsic