From 1808a1f8e4b7b102823492a2007a46929aebf189 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 22 Mar 2022 14:35:04 +0100 Subject: Add video edition finished notification --- shared/models/server/job.model.ts | 5 +++++ shared/models/users/user-notification-setting.model.ts | 2 ++ shared/models/users/user-notification.model.ts | 4 +++- shared/server-commands/server/config-command.ts | 10 ++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) (limited to 'shared') diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index d81b72696..3b4855eaa 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts @@ -1,4 +1,5 @@ import { ContextType } from '../activitypub/context' +import { VideoState } from '../videos' import { VideoEditorTaskCut } from '../videos/editor' import { VideoResolution } from '../videos/file/video-resolution.enum' import { SendEmailOptions } from './emailer.model' @@ -116,6 +117,9 @@ export type ManageVideoTorrentPayload = interface BaseTranscodingPayload { videoUUID: string isNewVideo?: boolean + + // Custom notification when the task is finished + notification?: 'default' | 'video-edition' } export interface HLSTranscodingPayload extends BaseTranscodingPayload { @@ -171,6 +175,7 @@ export interface DeleteResumableUploadMetaFilePayload { export interface MoveObjectStoragePayload { videoUUID: string isNewVideo: boolean + previousVideoState: VideoState } export type VideoEditorTaskCutPayload = VideoEditorTaskCut diff --git a/shared/models/users/user-notification-setting.model.ts b/shared/models/users/user-notification-setting.model.ts index 977e6b985..35656f14c 100644 --- a/shared/models/users/user-notification-setting.model.ts +++ b/shared/models/users/user-notification-setting.model.ts @@ -27,4 +27,6 @@ export interface UserNotificationSetting { newPeerTubeVersion: UserNotificationSettingValue newPluginVersion: UserNotificationSettingValue + + myVideoEditionFinished: UserNotificationSettingValue } diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts index a2621fb5b..a2918194f 100644 --- a/shared/models/users/user-notification.model.ts +++ b/shared/models/users/user-notification.model.ts @@ -30,7 +30,9 @@ export const enum UserNotificationType { ABUSE_NEW_MESSAGE = 16, NEW_PLUGIN_VERSION = 17, - NEW_PEERTUBE_VERSION = 18 + NEW_PEERTUBE_VERSION = 18, + + MY_VIDEO_EDITION_FINISHED = 19 } export interface VideoInfo { diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 1dd6e1ea4..35a1eec7c 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts @@ -111,6 +111,16 @@ export class ConfigCommand extends AbstractCommand { }) } + enableEditor () { + return this.updateExistingSubConfig({ + newConfig: { + videoEditor: { + enabled: true + } + } + }) + } + getConfig (options: OverrideCommandOptions = {}) { const path = '/api/v1/config' -- cgit v1.2.3