From 92e66e04f7f51d37b465cff442ce47f6d6d7cadd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 22 Mar 2022 16:58:49 +0100 Subject: Rename studio to editor --- shared/server-commands/videos/index.ts | 2 +- .../server-commands/videos/video-editor-command.ts | 67 ---------------------- .../server-commands/videos/video-studio-command.ts | 67 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 shared/server-commands/videos/video-editor-command.ts create mode 100644 shared/server-commands/videos/video-studio-command.ts (limited to 'shared/server-commands/videos') diff --git a/shared/server-commands/videos/index.ts b/shared/server-commands/videos/index.ts index 154aed9a6..c9ef6134d 100644 --- a/shared/server-commands/videos/index.ts +++ b/shared/server-commands/videos/index.ts @@ -12,5 +12,5 @@ export * from './playlists-command' export * from './services-command' export * from './streaming-playlists-command' export * from './comments-command' -export * from './video-editor-command' +export * from './video-studio-command' export * from './videos-command' diff --git a/shared/server-commands/videos/video-editor-command.ts b/shared/server-commands/videos/video-editor-command.ts deleted file mode 100644 index 485edce8e..000000000 --- a/shared/server-commands/videos/video-editor-command.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { HttpStatusCode, VideoEditorTask } from '@shared/models' -import { AbstractCommand, OverrideCommandOptions } from '../shared' - -export class VideoEditorCommand extends AbstractCommand { - - static getComplexTask (): VideoEditorTask[] { - return [ - // Total duration: 2 - { - name: 'cut', - options: { - start: 1, - end: 3 - } - }, - - // Total duration: 7 - { - name: 'add-outro', - options: { - file: 'video_short.webm' - } - }, - - { - name: 'add-watermark', - options: { - file: 'thumbnail.png' - } - }, - - // Total duration: 9 - { - name: 'add-intro', - options: { - file: 'video_very_short_240p.mp4' - } - } - ] - } - - createEditionTasks (options: OverrideCommandOptions & { - videoId: number | string - tasks: VideoEditorTask[] - }) { - const path = '/api/v1/videos/' + options.videoId + '/editor/edit' - const attaches: { [id: string]: any } = {} - - for (let i = 0; i < options.tasks.length; i++) { - const task = options.tasks[i] - - if (task.name === 'add-intro' || task.name === 'add-outro' || task.name === 'add-watermark') { - attaches[`tasks[${i}][options][file]`] = task.options.file - } - } - - return this.postUploadRequest({ - ...options, - - path, - attaches, - fields: { tasks: options.tasks }, - implicitToken: true, - defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 - }) - } -} diff --git a/shared/server-commands/videos/video-studio-command.ts b/shared/server-commands/videos/video-studio-command.ts new file mode 100644 index 000000000..9fe467cc2 --- /dev/null +++ b/shared/server-commands/videos/video-studio-command.ts @@ -0,0 +1,67 @@ +import { HttpStatusCode, VideoStudioTask } from '@shared/models' +import { AbstractCommand, OverrideCommandOptions } from '../shared' + +export class VideoStudioCommand extends AbstractCommand { + + static getComplexTask (): VideoStudioTask[] { + return [ + // Total duration: 2 + { + name: 'cut', + options: { + start: 1, + end: 3 + } + }, + + // Total duration: 7 + { + name: 'add-outro', + options: { + file: 'video_short.webm' + } + }, + + { + name: 'add-watermark', + options: { + file: 'thumbnail.png' + } + }, + + // Total duration: 9 + { + name: 'add-intro', + options: { + file: 'video_very_short_240p.mp4' + } + } + ] + } + + createEditionTasks (options: OverrideCommandOptions & { + videoId: number | string + tasks: VideoStudioTask[] + }) { + const path = '/api/v1/videos/' + options.videoId + '/studio/edit' + const attaches: { [id: string]: any } = {} + + for (let i = 0; i < options.tasks.length; i++) { + const task = options.tasks[i] + + if (task.name === 'add-intro' || task.name === 'add-outro' || task.name === 'add-watermark') { + attaches[`tasks[${i}][options][file]`] = task.options.file + } + } + + return this.postUploadRequest({ + ...options, + + path, + attaches, + fields: { tasks: options.tasks }, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) + } +} -- cgit v1.2.3