diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-22 16:58:49 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-22 17:24:32 +0100 |
commit | 92e66e04f7f51d37b465cff442ce47f6d6d7cadd (patch) | |
tree | 4475c5c601c0f6673ca56afba5b7f70a4fae4ec3 /server | |
parent | 1808a1f8e4b7b102823492a2007a46929aebf189 (diff) | |
download | PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.gz PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.zst PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.zip |
Rename studio to editor
Diffstat (limited to 'server')
32 files changed, 176 insertions, 176 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 376143cb8..cfb750bc9 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -259,8 +259,8 @@ function customConfig (): CustomConfig { | |||
259 | } | 259 | } |
260 | } | 260 | } |
261 | }, | 261 | }, |
262 | videoEditor: { | 262 | videoStudio: { |
263 | enabled: CONFIG.VIDEO_EDITOR.ENABLED | 263 | enabled: CONFIG.VIDEO_STUDIO.ENABLED |
264 | }, | 264 | }, |
265 | import: { | 265 | import: { |
266 | videos: { | 266 | videos: { |
diff --git a/server/controllers/api/users/my-notifications.ts b/server/controllers/api/users/my-notifications.ts index 55184dc0f..6014cdbbf 100644 --- a/server/controllers/api/users/my-notifications.ts +++ b/server/controllers/api/users/my-notifications.ts | |||
@@ -83,7 +83,7 @@ async function updateNotificationSettings (req: express.Request, res: express.Re | |||
83 | abuseStateChange: body.abuseStateChange, | 83 | abuseStateChange: body.abuseStateChange, |
84 | newPeerTubeVersion: body.newPeerTubeVersion, | 84 | newPeerTubeVersion: body.newPeerTubeVersion, |
85 | newPluginVersion: body.newPluginVersion, | 85 | newPluginVersion: body.newPluginVersion, |
86 | myVideoEditionFinished: body.myVideoEditionFinished | 86 | myVideoStudioEditionFinished: body.myVideoStudioEditionFinished |
87 | } | 87 | } |
88 | 88 | ||
89 | await UserNotificationSettingModel.update(values, query) | 89 | await UserNotificationSettingModel.update(values, query) |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index a5ae07d95..c7617093c 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -35,7 +35,7 @@ import { VideoModel } from '../../../models/video/video' | |||
35 | import { blacklistRouter } from './blacklist' | 35 | import { blacklistRouter } from './blacklist' |
36 | import { videoCaptionsRouter } from './captions' | 36 | import { videoCaptionsRouter } from './captions' |
37 | import { videoCommentRouter } from './comment' | 37 | import { videoCommentRouter } from './comment' |
38 | import { editorRouter } from './editor' | 38 | import { studioRouter } from './studio' |
39 | import { filesRouter } from './files' | 39 | import { filesRouter } from './files' |
40 | import { videoImportsRouter } from './import' | 40 | import { videoImportsRouter } from './import' |
41 | import { liveRouter } from './live' | 41 | import { liveRouter } from './live' |
@@ -52,7 +52,7 @@ const videosRouter = express.Router() | |||
52 | videosRouter.use('/', blacklistRouter) | 52 | videosRouter.use('/', blacklistRouter) |
53 | videosRouter.use('/', rateVideoRouter) | 53 | videosRouter.use('/', rateVideoRouter) |
54 | videosRouter.use('/', videoCommentRouter) | 54 | videosRouter.use('/', videoCommentRouter) |
55 | videosRouter.use('/', editorRouter) | 55 | videosRouter.use('/', studioRouter) |
56 | videosRouter.use('/', videoCaptionsRouter) | 56 | videosRouter.use('/', videoCaptionsRouter) |
57 | videosRouter.use('/', videoImportsRouter) | 57 | videosRouter.use('/', videoImportsRouter) |
58 | videosRouter.use('/', ownershipVideoRouter) | 58 | videosRouter.use('/', ownershipVideoRouter) |
diff --git a/server/controllers/api/videos/editor.ts b/server/controllers/api/videos/studio.ts index 588cc1a8c..bff344f3f 100644 --- a/server/controllers/api/videos/editor.ts +++ b/server/controllers/api/videos/studio.ts | |||
@@ -2,26 +2,26 @@ import express from 'express' | |||
2 | import { createAnyReqFiles } from '@server/helpers/express-utils' | 2 | import { createAnyReqFiles } from '@server/helpers/express-utils' |
3 | import { MIMETYPES } from '@server/initializers/constants' | 3 | import { MIMETYPES } from '@server/initializers/constants' |
4 | import { JobQueue } from '@server/lib/job-queue' | 4 | import { JobQueue } from '@server/lib/job-queue' |
5 | import { buildTaskFileFieldname, getTaskFile } from '@server/lib/video-editor' | 5 | import { buildTaskFileFieldname, getTaskFile } from '@server/lib/video-studio' |
6 | import { | 6 | import { |
7 | HttpStatusCode, | 7 | HttpStatusCode, |
8 | VideoEditionTaskPayload, | 8 | VideoState, |
9 | VideoEditorCreateEdition, | 9 | VideoStudioCreateEdition, |
10 | VideoEditorTask, | 10 | VideoStudioTask, |
11 | VideoEditorTaskCut, | 11 | VideoStudioTaskCut, |
12 | VideoEditorTaskIntro, | 12 | VideoStudioTaskIntro, |
13 | VideoEditorTaskOutro, | 13 | VideoStudioTaskOutro, |
14 | VideoEditorTaskWatermark, | 14 | VideoStudioTaskPayload, |
15 | VideoState | 15 | VideoStudioTaskWatermark |
16 | } from '@shared/models' | 16 | } from '@shared/models' |
17 | import { asyncMiddleware, authenticate, videosEditorAddEditionValidator } from '../../../middlewares' | 17 | import { asyncMiddleware, authenticate, videoStudioAddEditionValidator } from '../../../middlewares' |
18 | 18 | ||
19 | const editorRouter = express.Router() | 19 | const studioRouter = express.Router() |
20 | 20 | ||
21 | const tasksFiles = createAnyReqFiles( | 21 | const tasksFiles = createAnyReqFiles( |
22 | MIMETYPES.VIDEO.MIMETYPE_EXT, | 22 | MIMETYPES.VIDEO.MIMETYPE_EXT, |
23 | (req: express.Request, file: Express.Multer.File, cb: (err: Error, result?: boolean) => void) => { | 23 | (req: express.Request, file: Express.Multer.File, cb: (err: Error, result?: boolean) => void) => { |
24 | const body = req.body as VideoEditorCreateEdition | 24 | const body = req.body as VideoStudioCreateEdition |
25 | 25 | ||
26 | // Fetch array element | 26 | // Fetch array element |
27 | const matches = file.fieldname.match(/tasks\[(\d+)\]/) | 27 | const matches = file.fieldname.match(/tasks\[(\d+)\]/) |
@@ -43,24 +43,24 @@ const tasksFiles = createAnyReqFiles( | |||
43 | } | 43 | } |
44 | ) | 44 | ) |
45 | 45 | ||
46 | editorRouter.post('/:videoId/editor/edit', | 46 | studioRouter.post('/:videoId/studio/edit', |
47 | authenticate, | 47 | authenticate, |
48 | tasksFiles, | 48 | tasksFiles, |
49 | asyncMiddleware(videosEditorAddEditionValidator), | 49 | asyncMiddleware(videoStudioAddEditionValidator), |
50 | asyncMiddleware(createEditionTasks) | 50 | asyncMiddleware(createEditionTasks) |
51 | ) | 51 | ) |
52 | 52 | ||
53 | // --------------------------------------------------------------------------- | 53 | // --------------------------------------------------------------------------- |
54 | 54 | ||
55 | export { | 55 | export { |
56 | editorRouter | 56 | studioRouter |
57 | } | 57 | } |
58 | 58 | ||
59 | // --------------------------------------------------------------------------- | 59 | // --------------------------------------------------------------------------- |
60 | 60 | ||
61 | async function createEditionTasks (req: express.Request, res: express.Response) { | 61 | async function createEditionTasks (req: express.Request, res: express.Response) { |
62 | const files = req.files as Express.Multer.File[] | 62 | const files = req.files as Express.Multer.File[] |
63 | const body = req.body as VideoEditorCreateEdition | 63 | const body = req.body as VideoStudioCreateEdition |
64 | const video = res.locals.videoAll | 64 | const video = res.locals.videoAll |
65 | 65 | ||
66 | video.state = VideoState.TO_EDIT | 66 | video.state = VideoState.TO_EDIT |
@@ -71,13 +71,13 @@ async function createEditionTasks (req: express.Request, res: express.Response) | |||
71 | tasks: body.tasks.map((t, i) => buildTaskPayload(t, i, files)) | 71 | tasks: body.tasks.map((t, i) => buildTaskPayload(t, i, files)) |
72 | } | 72 | } |
73 | 73 | ||
74 | JobQueue.Instance.createJob({ type: 'video-edition', payload }) | 74 | JobQueue.Instance.createJob({ type: 'video-studio-edition', payload }) |
75 | 75 | ||
76 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) | 76 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
77 | } | 77 | } |
78 | 78 | ||
79 | const taskPayloadBuilders: { | 79 | const taskPayloadBuilders: { |
80 | [id in VideoEditorTask['name']]: (task: VideoEditorTask, indice?: number, files?: Express.Multer.File[]) => VideoEditionTaskPayload | 80 | [id in VideoStudioTask['name']]: (task: VideoStudioTask, indice?: number, files?: Express.Multer.File[]) => VideoStudioTaskPayload |
81 | } = { | 81 | } = { |
82 | 'add-intro': buildIntroOutroTask, | 82 | 'add-intro': buildIntroOutroTask, |
83 | 'add-outro': buildIntroOutroTask, | 83 | 'add-outro': buildIntroOutroTask, |
@@ -85,11 +85,11 @@ const taskPayloadBuilders: { | |||
85 | 'add-watermark': buildWatermarkTask | 85 | 'add-watermark': buildWatermarkTask |
86 | } | 86 | } |
87 | 87 | ||
88 | function buildTaskPayload (task: VideoEditorTask, indice: number, files: Express.Multer.File[]): VideoEditionTaskPayload { | 88 | function buildTaskPayload (task: VideoStudioTask, indice: number, files: Express.Multer.File[]): VideoStudioTaskPayload { |
89 | return taskPayloadBuilders[task.name](task, indice, files) | 89 | return taskPayloadBuilders[task.name](task, indice, files) |
90 | } | 90 | } |
91 | 91 | ||
92 | function buildIntroOutroTask (task: VideoEditorTaskIntro | VideoEditorTaskOutro, indice: number, files: Express.Multer.File[]) { | 92 | function buildIntroOutroTask (task: VideoStudioTaskIntro | VideoStudioTaskOutro, indice: number, files: Express.Multer.File[]) { |
93 | return { | 93 | return { |
94 | name: task.name, | 94 | name: task.name, |
95 | options: { | 95 | options: { |
@@ -98,7 +98,7 @@ function buildIntroOutroTask (task: VideoEditorTaskIntro | VideoEditorTaskOutro, | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | function buildCutTask (task: VideoEditorTaskCut) { | 101 | function buildCutTask (task: VideoStudioTaskCut) { |
102 | return { | 102 | return { |
103 | name: task.name, | 103 | name: task.name, |
104 | options: { | 104 | options: { |
@@ -108,7 +108,7 @@ function buildCutTask (task: VideoEditorTaskCut) { | |||
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | function buildWatermarkTask (task: VideoEditorTaskWatermark, indice: number, files: Express.Multer.File[]) { | 111 | function buildWatermarkTask (task: VideoStudioTaskWatermark, indice: number, files: Express.Multer.File[]) { |
112 | return { | 112 | return { |
113 | name: task.name, | 113 | name: task.name, |
114 | options: { | 114 | options: { |
diff --git a/server/helpers/custom-validators/video-editor.ts b/server/helpers/custom-validators/video-studio.ts index 09238675e..19e7906d5 100644 --- a/server/helpers/custom-validators/video-editor.ts +++ b/server/helpers/custom-validators/video-studio.ts | |||
@@ -1,40 +1,40 @@ | |||
1 | import validator from 'validator' | 1 | import validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' | 2 | import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' |
3 | import { buildTaskFileFieldname } from '@server/lib/video-editor' | 3 | import { buildTaskFileFieldname } from '@server/lib/video-studio' |
4 | import { VideoEditorTask } from '@shared/models' | 4 | import { VideoStudioTask } from '@shared/models' |
5 | import { isArray } from './misc' | 5 | import { isArray } from './misc' |
6 | import { isVideoFileMimeTypeValid, isVideoImageValid } from './videos' | 6 | import { isVideoFileMimeTypeValid, isVideoImageValid } from './videos' |
7 | 7 | ||
8 | function isValidEditorTasksArray (tasks: any) { | 8 | function isValidStudioTasksArray (tasks: any) { |
9 | if (!isArray(tasks)) return false | 9 | if (!isArray(tasks)) return false |
10 | 10 | ||
11 | return tasks.length >= CONSTRAINTS_FIELDS.VIDEO_EDITOR.TASKS.min && | 11 | return tasks.length >= CONSTRAINTS_FIELDS.VIDEO_STUDIO.TASKS.min && |
12 | tasks.length <= CONSTRAINTS_FIELDS.VIDEO_EDITOR.TASKS.max | 12 | tasks.length <= CONSTRAINTS_FIELDS.VIDEO_STUDIO.TASKS.max |
13 | } | 13 | } |
14 | 14 | ||
15 | function isEditorCutTaskValid (task: VideoEditorTask) { | 15 | function isStudioCutTaskValid (task: VideoStudioTask) { |
16 | if (task.name !== 'cut') return false | 16 | if (task.name !== 'cut') return false |
17 | if (!task.options) return false | 17 | if (!task.options) return false |
18 | 18 | ||
19 | const { start, end } = task.options | 19 | const { start, end } = task.options |
20 | if (!start && !end) return false | 20 | if (!start && !end) return false |
21 | 21 | ||
22 | if (start && !validator.isInt(start + '', CONSTRAINTS_FIELDS.VIDEO_EDITOR.CUT_TIME)) return false | 22 | if (start && !validator.isInt(start + '', CONSTRAINTS_FIELDS.VIDEO_STUDIO.CUT_TIME)) return false |
23 | if (end && !validator.isInt(end + '', CONSTRAINTS_FIELDS.VIDEO_EDITOR.CUT_TIME)) return false | 23 | if (end && !validator.isInt(end + '', CONSTRAINTS_FIELDS.VIDEO_STUDIO.CUT_TIME)) return false |
24 | 24 | ||
25 | if (!start || !end) return true | 25 | if (!start || !end) return true |
26 | 26 | ||
27 | return parseInt(start + '') < parseInt(end + '') | 27 | return parseInt(start + '') < parseInt(end + '') |
28 | } | 28 | } |
29 | 29 | ||
30 | function isEditorTaskAddIntroOutroValid (task: VideoEditorTask, indice: number, files: Express.Multer.File[]) { | 30 | function isStudioTaskAddIntroOutroValid (task: VideoStudioTask, indice: number, files: Express.Multer.File[]) { |
31 | const file = files.find(f => f.fieldname === buildTaskFileFieldname(indice, 'file')) | 31 | const file = files.find(f => f.fieldname === buildTaskFileFieldname(indice, 'file')) |
32 | 32 | ||
33 | return (task.name === 'add-intro' || task.name === 'add-outro') && | 33 | return (task.name === 'add-intro' || task.name === 'add-outro') && |
34 | file && isVideoFileMimeTypeValid([ file ], null) | 34 | file && isVideoFileMimeTypeValid([ file ], null) |
35 | } | 35 | } |
36 | 36 | ||
37 | function isEditorTaskAddWatermarkValid (task: VideoEditorTask, indice: number, files: Express.Multer.File[]) { | 37 | function isStudioTaskAddWatermarkValid (task: VideoStudioTask, indice: number, files: Express.Multer.File[]) { |
38 | const file = files.find(f => f.fieldname === buildTaskFileFieldname(indice, 'file')) | 38 | const file = files.find(f => f.fieldname === buildTaskFileFieldname(indice, 'file')) |
39 | 39 | ||
40 | return task.name === 'add-watermark' && | 40 | return task.name === 'add-watermark' && |
@@ -44,9 +44,9 @@ function isEditorTaskAddWatermarkValid (task: VideoEditorTask, indice: number, f | |||
44 | // --------------------------------------------------------------------------- | 44 | // --------------------------------------------------------------------------- |
45 | 45 | ||
46 | export { | 46 | export { |
47 | isValidEditorTasksArray, | 47 | isValidStudioTasksArray, |
48 | 48 | ||
49 | isEditorCutTaskValid, | 49 | isStudioCutTaskValid, |
50 | isEditorTaskAddIntroOutroValid, | 50 | isStudioTaskAddIntroOutroValid, |
51 | isEditorTaskAddWatermarkValid | 51 | isStudioTaskAddWatermarkValid |
52 | } | 52 | } |
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index 635a32010..f65798c42 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts | |||
@@ -49,7 +49,7 @@ function checkConfig () { | |||
49 | checkSearchConfig() | 49 | checkSearchConfig() |
50 | checkLiveConfig() | 50 | checkLiveConfig() |
51 | checkObjectStorageConfig() | 51 | checkObjectStorageConfig() |
52 | checkVideoEditorConfig() | 52 | checkVideoStudioConfig() |
53 | } | 53 | } |
54 | 54 | ||
55 | // We get db by param to not import it in this file (import orders) | 55 | // We get db by param to not import it in this file (import orders) |
@@ -260,8 +260,8 @@ function checkObjectStorageConfig () { | |||
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | function checkVideoEditorConfig () { | 263 | function checkVideoStudioConfig () { |
264 | if (CONFIG.VIDEO_EDITOR.ENABLED === true && CONFIG.TRANSCODING.ENABLED === false) { | 264 | if (CONFIG.VIDEO_STUDIO.ENABLED === true && CONFIG.TRANSCODING.ENABLED === false) { |
265 | throw new Error('Video editor cannot be enabled if transcoding is disabled') | 265 | throw new Error('Video studio cannot be enabled if transcoding is disabled') |
266 | } | 266 | } |
267 | } | 267 | } |
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index fa311f708..0f23a2d73 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -30,7 +30,7 @@ function checkMissedConfig () { | |||
30 | 'transcoding.profile', 'transcoding.concurrency', | 30 | 'transcoding.profile', 'transcoding.concurrency', |
31 | 'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', | 31 | 'transcoding.resolutions.0p', 'transcoding.resolutions.144p', 'transcoding.resolutions.240p', 'transcoding.resolutions.360p', |
32 | 'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', | 32 | 'transcoding.resolutions.480p', 'transcoding.resolutions.720p', 'transcoding.resolutions.1080p', 'transcoding.resolutions.1440p', |
33 | 'transcoding.resolutions.2160p', 'video_editor.enabled', | 33 | 'transcoding.resolutions.2160p', 'video_studio.enabled', |
34 | 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'auto_blacklist.videos.of_users.enabled', | 34 | 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'auto_blacklist.videos.of_users.enabled', |
35 | 'trending.videos.interval_days', | 35 | 'trending.videos.interval_days', |
36 | 'client.videos.miniature.display_author_avatar', | 36 | 'client.videos.miniature.display_author_avatar', |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 1658298c5..122cb9472 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -335,8 +335,8 @@ const CONFIG = { | |||
335 | } | 335 | } |
336 | } | 336 | } |
337 | }, | 337 | }, |
338 | VIDEO_EDITOR: { | 338 | VIDEO_STUDIO: { |
339 | get ENABLED () { return config.get<boolean>('video_editor.enabled') } | 339 | get ENABLED () { return config.get<boolean>('video_studio.enabled') } |
340 | }, | 340 | }, |
341 | IMPORT: { | 341 | IMPORT: { |
342 | VIDEOS: { | 342 | VIDEOS: { |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 17d8ba556..6bcefe0db 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -152,7 +152,7 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = { | |||
152 | 'activitypub-refresher': 1, | 152 | 'activitypub-refresher': 1, |
153 | 'video-redundancy': 1, | 153 | 'video-redundancy': 1, |
154 | 'video-live-ending': 1, | 154 | 'video-live-ending': 1, |
155 | 'video-edition': 1, | 155 | 'video-studio-edition': 1, |
156 | 'manage-video-torrent': 1, | 156 | 'manage-video-torrent': 1, |
157 | 'move-to-object-storage': 3 | 157 | 'move-to-object-storage': 3 |
158 | } | 158 | } |
@@ -170,7 +170,7 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im | |||
170 | 'activitypub-refresher': 1, | 170 | 'activitypub-refresher': 1, |
171 | 'video-redundancy': 1, | 171 | 'video-redundancy': 1, |
172 | 'video-live-ending': 10, | 172 | 'video-live-ending': 10, |
173 | 'video-edition': 1, | 173 | 'video-studio-edition': 1, |
174 | 'manage-video-torrent': 1, | 174 | 'manage-video-torrent': 1, |
175 | 'move-to-object-storage': 1 | 175 | 'move-to-object-storage': 1 |
176 | } | 176 | } |
@@ -182,7 +182,7 @@ const JOB_TTL: { [id in JobType]: number } = { | |||
182 | 'activitypub-cleaner': 1000 * 3600, // 1 hour | 182 | 'activitypub-cleaner': 1000 * 3600, // 1 hour |
183 | 'video-file-import': 1000 * 3600, // 1 hour | 183 | 'video-file-import': 1000 * 3600, // 1 hour |
184 | 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long | 184 | 'video-transcoding': 1000 * 3600 * 48, // 2 days, transcoding could be long |
185 | 'video-edition': 1000 * 3600 * 10, // 10 hours | 185 | 'video-studio-edition': 1000 * 3600 * 10, // 10 hours |
186 | 'video-import': 1000 * 3600 * 2, // 2 hours | 186 | 'video-import': 1000 * 3600 * 2, // 2 hours |
187 | 'email': 60000 * 10, // 10 minutes | 187 | 'email': 60000 * 10, // 10 minutes |
188 | 'actor-keys': 60000 * 20, // 20 minutes | 188 | 'actor-keys': 60000 * 20, // 20 minutes |
@@ -358,7 +358,7 @@ const CONSTRAINTS_FIELDS = { | |||
358 | COMMONS: { | 358 | COMMONS: { |
359 | URL: { min: 5, max: 2000 } // Length | 359 | URL: { min: 5, max: 2000 } // Length |
360 | }, | 360 | }, |
361 | VIDEO_EDITOR: { | 361 | VIDEO_STUDIO: { |
362 | TASKS: { min: 1, max: 10 }, // Number of tasks | 362 | TASKS: { min: 1, max: 10 }, // Number of tasks |
363 | CUT_TIME: { min: 0 } // Value | 363 | CUT_TIME: { min: 0 } // Value |
364 | } | 364 | } |
diff --git a/server/initializers/migrations/0700-edition-finished-notification.ts b/server/initializers/migrations/0700-edition-finished-notification.ts index 103c0b456..5310eab3f 100644 --- a/server/initializers/migrations/0700-edition-finished-notification.ts +++ b/server/initializers/migrations/0700-edition-finished-notification.ts | |||
@@ -14,11 +14,11 @@ async function up (utils: { | |||
14 | defaultValue: null, | 14 | defaultValue: null, |
15 | allowNull: true | 15 | allowNull: true |
16 | } | 16 | } |
17 | await utils.queryInterface.addColumn('userNotificationSetting', 'myVideoEditionFinished', data, { transaction }) | 17 | await utils.queryInterface.addColumn('userNotificationSetting', 'myVideoStudioEditionFinished', data, { transaction }) |
18 | } | 18 | } |
19 | 19 | ||
20 | { | 20 | { |
21 | const query = 'UPDATE "userNotificationSetting" SET "myVideoEditionFinished" = 1' | 21 | const query = 'UPDATE "userNotificationSetting" SET "myVideoStudioEditionFinished" = 1' |
22 | await utils.sequelize.query(query, { transaction }) | 22 | await utils.sequelize.query(query, { transaction }) |
23 | } | 23 | } |
24 | 24 | ||
@@ -28,7 +28,7 @@ async function up (utils: { | |||
28 | defaultValue: null, | 28 | defaultValue: null, |
29 | allowNull: false | 29 | allowNull: false |
30 | } | 30 | } |
31 | await utils.queryInterface.changeColumn('userNotificationSetting', 'myVideoEditionFinished', data, { transaction }) | 31 | await utils.queryInterface.changeColumn('userNotificationSetting', 'myVideoStudioEditionFinished', data, { transaction }) |
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
diff --git a/server/lib/job-queue/handlers/video-edition.ts b/server/lib/job-queue/handlers/video-studio-edition.ts index d2d2a4f65..cf3064a7a 100644 --- a/server/lib/job-queue/handlers/video-edition.ts +++ b/server/lib/job-queue/handlers/video-studio-edition.ts | |||
@@ -9,8 +9,8 @@ import { generateWebTorrentVideoFilename } from '@server/lib/paths' | |||
9 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles' | 9 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles' |
10 | import { isAbleToUploadVideo } from '@server/lib/user' | 10 | import { isAbleToUploadVideo } from '@server/lib/user' |
11 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' | 11 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' |
12 | import { approximateIntroOutroAdditionalSize } from '@server/lib/video-editor' | ||
13 | import { VideoPathManager } from '@server/lib/video-path-manager' | 12 | import { VideoPathManager } from '@server/lib/video-path-manager' |
13 | import { approximateIntroOutroAdditionalSize } from '@server/lib/video-studio' | ||
14 | import { UserModel } from '@server/models/user/user' | 14 | import { UserModel } from '@server/models/user/user' |
15 | import { VideoModel } from '@server/models/video/video' | 15 | import { VideoModel } from '@server/models/video/video' |
16 | import { VideoFileModel } from '@server/models/video/video-file' | 16 | import { VideoFileModel } from '@server/models/video/video-file' |
@@ -26,23 +26,23 @@ import { | |||
26 | getVideoStreamFPS | 26 | getVideoStreamFPS |
27 | } from '@shared/extra-utils' | 27 | } from '@shared/extra-utils' |
28 | import { | 28 | import { |
29 | VideoEditionPayload, | 29 | VideoStudioEditionPayload, |
30 | VideoEditionTaskPayload, | 30 | VideoStudioTaskPayload, |
31 | VideoEditorTask, | 31 | VideoStudioTaskCutPayload, |
32 | VideoEditorTaskCutPayload, | 32 | VideoStudioTaskIntroPayload, |
33 | VideoEditorTaskIntroPayload, | 33 | VideoStudioTaskOutroPayload, |
34 | VideoEditorTaskOutroPayload, | 34 | VideoStudioTaskWatermarkPayload, |
35 | VideoEditorTaskWatermarkPayload | 35 | VideoStudioTask |
36 | } from '@shared/models' | 36 | } from '@shared/models' |
37 | import { logger, loggerTagsFactory } from '../../../helpers/logger' | 37 | import { logger, loggerTagsFactory } from '../../../helpers/logger' |
38 | 38 | ||
39 | const lTagsBase = loggerTagsFactory('video-edition') | 39 | const lTagsBase = loggerTagsFactory('video-edition') |
40 | 40 | ||
41 | async function processVideoEdition (job: Job) { | 41 | async function processVideoStudioEdition (job: Job) { |
42 | const payload = job.data as VideoEditionPayload | 42 | const payload = job.data as VideoStudioEditionPayload |
43 | const lTags = lTagsBase(payload.videoUUID) | 43 | const lTags = lTagsBase(payload.videoUUID) |
44 | 44 | ||
45 | logger.info('Process video edition of %s in job %d.', payload.videoUUID, job.id, lTags) | 45 | logger.info('Process video studio edition of %s in job %d.', payload.videoUUID, job.id, lTags) |
46 | 46 | ||
47 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID) | 47 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID) |
48 | 48 | ||
@@ -106,12 +106,12 @@ async function processVideoEdition (job: Job) { | |||
106 | // --------------------------------------------------------------------------- | 106 | // --------------------------------------------------------------------------- |
107 | 107 | ||
108 | export { | 108 | export { |
109 | processVideoEdition | 109 | processVideoStudioEdition |
110 | } | 110 | } |
111 | 111 | ||
112 | // --------------------------------------------------------------------------- | 112 | // --------------------------------------------------------------------------- |
113 | 113 | ||
114 | type TaskProcessorOptions <T extends VideoEditionTaskPayload = VideoEditionTaskPayload> = { | 114 | type TaskProcessorOptions <T extends VideoStudioTaskPayload = VideoStudioTaskPayload> = { |
115 | inputPath: string | 115 | inputPath: string |
116 | outputPath: string | 116 | outputPath: string |
117 | video: MVideo | 117 | video: MVideo |
@@ -119,7 +119,7 @@ type TaskProcessorOptions <T extends VideoEditionTaskPayload = VideoEditionTaskP | |||
119 | lTags: { tags: string[] } | 119 | lTags: { tags: string[] } |
120 | } | 120 | } |
121 | 121 | ||
122 | const taskProcessors: { [id in VideoEditorTask['name']]: (options: TaskProcessorOptions) => Promise<any> } = { | 122 | const taskProcessors: { [id in VideoStudioTask['name']]: (options: TaskProcessorOptions) => Promise<any> } = { |
123 | 'add-intro': processAddIntroOutro, | 123 | 'add-intro': processAddIntroOutro, |
124 | 'add-outro': processAddIntroOutro, | 124 | 'add-outro': processAddIntroOutro, |
125 | 'cut': processCut, | 125 | 'cut': processCut, |
@@ -137,7 +137,7 @@ async function processTask (options: TaskProcessorOptions) { | |||
137 | return processor(options) | 137 | return processor(options) |
138 | } | 138 | } |
139 | 139 | ||
140 | function processAddIntroOutro (options: TaskProcessorOptions<VideoEditorTaskIntroPayload | VideoEditorTaskOutroPayload>) { | 140 | function processAddIntroOutro (options: TaskProcessorOptions<VideoStudioTaskIntroPayload | VideoStudioTaskOutroPayload>) { |
141 | const { task } = options | 141 | const { task } = options |
142 | 142 | ||
143 | return addIntroOutro({ | 143 | return addIntroOutro({ |
@@ -153,7 +153,7 @@ function processAddIntroOutro (options: TaskProcessorOptions<VideoEditorTaskIntr | |||
153 | }) | 153 | }) |
154 | } | 154 | } |
155 | 155 | ||
156 | function processCut (options: TaskProcessorOptions<VideoEditorTaskCutPayload>) { | 156 | function processCut (options: TaskProcessorOptions<VideoStudioTaskCutPayload>) { |
157 | const { task } = options | 157 | const { task } = options |
158 | 158 | ||
159 | return cutVideo({ | 159 | return cutVideo({ |
@@ -164,7 +164,7 @@ function processCut (options: TaskProcessorOptions<VideoEditorTaskCutPayload>) { | |||
164 | }) | 164 | }) |
165 | } | 165 | } |
166 | 166 | ||
167 | function processAddWatermark (options: TaskProcessorOptions<VideoEditorTaskWatermarkPayload>) { | 167 | function processAddWatermark (options: TaskProcessorOptions<VideoStudioTaskWatermarkPayload>) { |
168 | const { task } = options | 168 | const { task } = options |
169 | 169 | ||
170 | return addWatermark({ | 170 | return addWatermark({ |
@@ -212,10 +212,10 @@ async function removeAllFiles (video: MVideoWithAllFiles, webTorrentFileExceptio | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | async function checkUserQuotaOrThrow (video: MVideoFullLight, payload: VideoEditionPayload) { | 215 | async function checkUserQuotaOrThrow (video: MVideoFullLight, payload: VideoStudioEditionPayload) { |
216 | const user = await UserModel.loadByVideoId(video.id) | 216 | const user = await UserModel.loadByVideoId(video.id) |
217 | 217 | ||
218 | const filePathFinder = (i: number) => (payload.tasks[i] as VideoEditorTaskIntroPayload | VideoEditorTaskOutroPayload).options.file | 218 | const filePathFinder = (i: number) => (payload.tasks[i] as VideoStudioTaskIntroPayload | VideoStudioTaskOutroPayload).options.file |
219 | 219 | ||
220 | const additionalBytes = await approximateIntroOutroAdditionalSize(video, payload.tasks, filePathFinder) | 220 | const additionalBytes = await approximateIntroOutroAdditionalSize(video, payload.tasks, filePathFinder) |
221 | if (await isAbleToUploadVideo(user.id, additionalBytes) === false) { | 221 | if (await isAbleToUploadVideo(user.id, additionalBytes) === false) { |
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 3224abcc3..167b7b168 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -15,11 +15,11 @@ import { | |||
15 | ManageVideoTorrentPayload, | 15 | ManageVideoTorrentPayload, |
16 | MoveObjectStoragePayload, | 16 | MoveObjectStoragePayload, |
17 | RefreshPayload, | 17 | RefreshPayload, |
18 | VideoEditionPayload, | ||
19 | VideoFileImportPayload, | 18 | VideoFileImportPayload, |
20 | VideoImportPayload, | 19 | VideoImportPayload, |
21 | VideoLiveEndingPayload, | 20 | VideoLiveEndingPayload, |
22 | VideoRedundancyPayload, | 21 | VideoRedundancyPayload, |
22 | VideoStudioEditionPayload, | ||
23 | VideoTranscodingPayload | 23 | VideoTranscodingPayload |
24 | } from '../../../shared/models' | 24 | } from '../../../shared/models' |
25 | import { logger } from '../../helpers/logger' | 25 | import { logger } from '../../helpers/logger' |
@@ -34,10 +34,10 @@ import { processActorKeys } from './handlers/actor-keys' | |||
34 | import { processEmail } from './handlers/email' | 34 | import { processEmail } from './handlers/email' |
35 | import { processManageVideoTorrent } from './handlers/manage-video-torrent' | 35 | import { processManageVideoTorrent } from './handlers/manage-video-torrent' |
36 | import { processMoveToObjectStorage } from './handlers/move-to-object-storage' | 36 | import { processMoveToObjectStorage } from './handlers/move-to-object-storage' |
37 | import { processVideoEdition } from './handlers/video-edition' | ||
38 | import { processVideoFileImport } from './handlers/video-file-import' | 37 | import { processVideoFileImport } from './handlers/video-file-import' |
39 | import { processVideoImport } from './handlers/video-import' | 38 | import { processVideoImport } from './handlers/video-import' |
40 | import { processVideoLiveEnding } from './handlers/video-live-ending' | 39 | import { processVideoLiveEnding } from './handlers/video-live-ending' |
40 | import { processVideoStudioEdition } from './handlers/video-studio-edition' | ||
41 | import { processVideoTranscoding } from './handlers/video-transcoding' | 41 | import { processVideoTranscoding } from './handlers/video-transcoding' |
42 | import { processVideosViewsStats } from './handlers/video-views-stats' | 42 | import { processVideosViewsStats } from './handlers/video-views-stats' |
43 | 43 | ||
@@ -57,7 +57,7 @@ type CreateJobArgument = | |||
57 | { type: 'actor-keys', payload: ActorKeysPayload } | | 57 | { type: 'actor-keys', payload: ActorKeysPayload } | |
58 | { type: 'video-redundancy', payload: VideoRedundancyPayload } | | 58 | { type: 'video-redundancy', payload: VideoRedundancyPayload } | |
59 | { type: 'delete-resumable-upload-meta-file', payload: DeleteResumableUploadMetaFilePayload } | | 59 | { type: 'delete-resumable-upload-meta-file', payload: DeleteResumableUploadMetaFilePayload } | |
60 | { type: 'video-edition', payload: VideoEditionPayload } | | 60 | { type: 'video-studio-edition', payload: VideoStudioEditionPayload } | |
61 | { type: 'manage-video-torrent', payload: ManageVideoTorrentPayload } | | 61 | { type: 'manage-video-torrent', payload: ManageVideoTorrentPayload } | |
62 | { type: 'move-to-object-storage', payload: MoveObjectStoragePayload } | 62 | { type: 'move-to-object-storage', payload: MoveObjectStoragePayload } |
63 | 63 | ||
@@ -83,7 +83,7 @@ const handlers: { [id in JobType]: (job: Job) => Promise<any> } = { | |||
83 | 'video-redundancy': processVideoRedundancy, | 83 | 'video-redundancy': processVideoRedundancy, |
84 | 'move-to-object-storage': processMoveToObjectStorage, | 84 | 'move-to-object-storage': processMoveToObjectStorage, |
85 | 'manage-video-torrent': processManageVideoTorrent, | 85 | 'manage-video-torrent': processManageVideoTorrent, |
86 | 'video-edition': processVideoEdition | 86 | 'video-studio-edition': processVideoStudioEdition |
87 | } | 87 | } |
88 | 88 | ||
89 | const jobTypes: JobType[] = [ | 89 | const jobTypes: JobType[] = [ |
@@ -103,7 +103,7 @@ const jobTypes: JobType[] = [ | |||
103 | 'video-live-ending', | 103 | 'video-live-ending', |
104 | 'move-to-object-storage', | 104 | 'move-to-object-storage', |
105 | 'manage-video-torrent', | 105 | 'manage-video-torrent', |
106 | 'video-edition' | 106 | 'video-studio-edition' |
107 | ] | 107 | ] |
108 | 108 | ||
109 | class JobQueue { | 109 | class JobQueue { |
diff --git a/server/lib/notifier/notifier.ts b/server/lib/notifier/notifier.ts index e34a82603..a6f13780b 100644 --- a/server/lib/notifier/notifier.ts +++ b/server/lib/notifier/notifier.ts | |||
@@ -12,7 +12,7 @@ import { | |||
12 | AbuseStateChangeForReporter, | 12 | AbuseStateChangeForReporter, |
13 | AutoFollowForInstance, | 13 | AutoFollowForInstance, |
14 | CommentMention, | 14 | CommentMention, |
15 | EditionFinishedForOwner, | 15 | StudioEditionFinishedForOwner, |
16 | FollowForInstance, | 16 | FollowForInstance, |
17 | FollowForUser, | 17 | FollowForUser, |
18 | ImportFinishedForOwner, | 18 | ImportFinishedForOwner, |
@@ -55,7 +55,7 @@ class Notifier { | |||
55 | newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ], | 55 | newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ], |
56 | newPeertubeVersion: [ NewPeerTubeVersionForAdmins ], | 56 | newPeertubeVersion: [ NewPeerTubeVersionForAdmins ], |
57 | newPluginVersion: [ NewPluginVersionForAdmins ], | 57 | newPluginVersion: [ NewPluginVersionForAdmins ], |
58 | videoEditionFinished: [ EditionFinishedForOwner ] | 58 | videoStudioEditionFinished: [ StudioEditionFinishedForOwner ] |
59 | } | 59 | } |
60 | 60 | ||
61 | private static instance: Notifier | 61 | private static instance: Notifier |
@@ -200,11 +200,11 @@ class Notifier { | |||
200 | .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err })) | 200 | .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err })) |
201 | } | 201 | } |
202 | 202 | ||
203 | notifyOfFinishedVideoEdition (video: MVideoFullLight) { | 203 | notifyOfFinishedVideoStudioEdition (video: MVideoFullLight) { |
204 | const models = this.notificationModels.videoEditionFinished | 204 | const models = this.notificationModels.videoStudioEditionFinished |
205 | 205 | ||
206 | this.sendNotifications(models, video) | 206 | this.sendNotifications(models, video) |
207 | .catch(err => logger.error('Cannot notify on finished edition %s.', video.url, { err })) | 207 | .catch(err => logger.error('Cannot notify on finished studio edition %s.', video.url, { err })) |
208 | } | 208 | } |
209 | 209 | ||
210 | private async notify <T> (object: AbstractNotification<T>) { | 210 | private async notify <T> (object: AbstractNotification<T>) { |
diff --git a/server/lib/notifier/shared/video-publication/index.ts b/server/lib/notifier/shared/video-publication/index.ts index 57f3443b9..5e92cb011 100644 --- a/server/lib/notifier/shared/video-publication/index.ts +++ b/server/lib/notifier/shared/video-publication/index.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | export * from './new-video-for-subscribers' | 1 | export * from './new-video-for-subscribers' |
2 | export * from './edition-finished-for-owner' | ||
3 | export * from './import-finished-for-owner' | 2 | export * from './import-finished-for-owner' |
4 | export * from './owned-publication-after-auto-unblacklist' | 3 | export * from './owned-publication-after-auto-unblacklist' |
5 | export * from './owned-publication-after-schedule-update' | 4 | export * from './owned-publication-after-schedule-update' |
6 | export * from './owned-publication-after-transcoding' | 5 | export * from './owned-publication-after-transcoding' |
6 | export * from './studio-edition-finished-for-owner' | ||
diff --git a/server/lib/notifier/shared/video-publication/edition-finished-for-owner.ts b/server/lib/notifier/shared/video-publication/studio-edition-finished-for-owner.ts index dec91f574..ee3027245 100644 --- a/server/lib/notifier/shared/video-publication/edition-finished-for-owner.ts +++ b/server/lib/notifier/shared/video-publication/studio-edition-finished-for-owner.ts | |||
@@ -6,7 +6,7 @@ import { MUserDefault, MUserWithNotificationSetting, MVideoFullLight, UserNotifi | |||
6 | import { UserNotificationType } from '@shared/models' | 6 | import { UserNotificationType } from '@shared/models' |
7 | import { AbstractNotification } from '../common/abstract-notification' | 7 | import { AbstractNotification } from '../common/abstract-notification' |
8 | 8 | ||
9 | export class EditionFinishedForOwner extends AbstractNotification <MVideoFullLight> { | 9 | export class StudioEditionFinishedForOwner extends AbstractNotification <MVideoFullLight> { |
10 | private user: MUserDefault | 10 | private user: MUserDefault |
11 | 11 | ||
12 | async prepare () { | 12 | async prepare () { |
@@ -14,11 +14,11 @@ export class EditionFinishedForOwner extends AbstractNotification <MVideoFullLig | |||
14 | } | 14 | } |
15 | 15 | ||
16 | log () { | 16 | log () { |
17 | logger.info('Notifying user %s its video edition %s is finished.', this.user.username, this.payload.url) | 17 | logger.info('Notifying user %s its video studio edition %s is finished.', this.user.username, this.payload.url) |
18 | } | 18 | } |
19 | 19 | ||
20 | getSetting (user: MUserWithNotificationSetting) { | 20 | getSetting (user: MUserWithNotificationSetting) { |
21 | return user.NotificationSetting.myVideoEditionFinished | 21 | return user.NotificationSetting.myVideoStudioEditionFinished |
22 | } | 22 | } |
23 | 23 | ||
24 | getTargetUsers () { | 24 | getTargetUsers () { |
@@ -29,7 +29,7 @@ export class EditionFinishedForOwner extends AbstractNotification <MVideoFullLig | |||
29 | 29 | ||
30 | async createNotification (user: MUserWithNotificationSetting) { | 30 | async createNotification (user: MUserWithNotificationSetting) { |
31 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ | 31 | const notification = await UserNotificationModel.create<UserNotificationModelForApi>({ |
32 | type: UserNotificationType.MY_VIDEO_EDITION_FINISHED, | 32 | type: UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED, |
33 | userId: user.id, | 33 | userId: user.id, |
34 | videoId: this.payload.id | 34 | videoId: this.payload.id |
35 | }) | 35 | }) |
diff --git a/server/lib/server-config-manager.ts b/server/lib/server-config-manager.ts index b920b73d5..d16a88f65 100644 --- a/server/lib/server-config-manager.ts +++ b/server/lib/server-config-manager.ts | |||
@@ -159,8 +159,8 @@ class ServerConfigManager { | |||
159 | port: CONFIG.LIVE.RTMP.PORT | 159 | port: CONFIG.LIVE.RTMP.PORT |
160 | } | 160 | } |
161 | }, | 161 | }, |
162 | videoEditor: { | 162 | videoStudio: { |
163 | enabled: CONFIG.VIDEO_EDITOR.ENABLED | 163 | enabled: CONFIG.VIDEO_STUDIO.ENABLED |
164 | }, | 164 | }, |
165 | import: { | 165 | import: { |
166 | videos: { | 166 | videos: { |
diff --git a/server/lib/user.ts b/server/lib/user.ts index 173d89d0b..310a3c30c 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -253,7 +253,7 @@ function createDefaultUserNotificationSettings (user: MUserId, t: Transaction | | |||
253 | autoInstanceFollowing: UserNotificationSettingValue.WEB, | 253 | autoInstanceFollowing: UserNotificationSettingValue.WEB, |
254 | newPeerTubeVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, | 254 | newPeerTubeVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, |
255 | newPluginVersion: UserNotificationSettingValue.WEB, | 255 | newPluginVersion: UserNotificationSettingValue.WEB, |
256 | myVideoEditionFinished: UserNotificationSettingValue.WEB | 256 | myVideoStudioEditionFinished: UserNotificationSettingValue.WEB |
257 | } | 257 | } |
258 | 258 | ||
259 | return UserNotificationSettingModel.create(values, { transaction: t }) | 259 | return UserNotificationSettingModel.create(values, { transaction: t }) |
diff --git a/server/lib/video-state.ts b/server/lib/video-state.ts index f75f81704..7b207eb87 100644 --- a/server/lib/video-state.ts +++ b/server/lib/video-state.ts | |||
@@ -135,7 +135,7 @@ async function moveToPublishedState (options: { | |||
135 | await federateVideoIfNeeded(video, isNewVideo, transaction) | 135 | await federateVideoIfNeeded(video, isNewVideo, transaction) |
136 | 136 | ||
137 | if (previousState === VideoState.TO_EDIT) { | 137 | if (previousState === VideoState.TO_EDIT) { |
138 | Notifier.Instance.notifyOfFinishedVideoEdition(video) | 138 | Notifier.Instance.notifyOfFinishedVideoStudioEdition(video) |
139 | return | 139 | return |
140 | } | 140 | } |
141 | 141 | ||
diff --git a/server/lib/video-editor.ts b/server/lib/video-studio.ts index 99b0bd949..cdacd35f2 100644 --- a/server/lib/video-editor.ts +++ b/server/lib/video-studio.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { MVideoFullLight } from "@server/types/models" | 1 | import { MVideoFullLight } from '@server/types/models' |
2 | import { getVideoStreamDuration } from "@shared/extra-utils" | 2 | import { getVideoStreamDuration } from '@shared/extra-utils' |
3 | import { VideoEditorTask } from "@shared/models" | 3 | import { VideoStudioTask } from '@shared/models' |
4 | 4 | ||
5 | function buildTaskFileFieldname (indice: number, fieldName = 'file') { | 5 | function buildTaskFileFieldname (indice: number, fieldName = 'file') { |
6 | return `tasks[${indice}][options][${fieldName}]` | 6 | return `tasks[${indice}][options][${fieldName}]` |
@@ -10,7 +10,7 @@ function getTaskFile (files: Express.Multer.File[], indice: number, fieldName = | |||
10 | return files.find(f => f.fieldname === buildTaskFileFieldname(indice, fieldName)) | 10 | return files.find(f => f.fieldname === buildTaskFileFieldname(indice, fieldName)) |
11 | } | 11 | } |
12 | 12 | ||
13 | async function approximateIntroOutroAdditionalSize (video: MVideoFullLight, tasks: VideoEditorTask[], fileFinder: (i: number) => string) { | 13 | async function approximateIntroOutroAdditionalSize (video: MVideoFullLight, tasks: VideoStudioTask[], fileFinder: (i: number) => string) { |
14 | let additionalDuration = 0 | 14 | let additionalDuration = 0 |
15 | 15 | ||
16 | for (let i = 0; i < tasks.length; i++) { | 16 | for (let i = 0; i < tasks.length; i++) { |
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index e87b2e39d..1e839d577 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -57,7 +57,7 @@ const customConfigUpdateValidator = [ | |||
57 | body('transcoding.webtorrent.enabled').isBoolean().withMessage('Should have a valid webtorrent transcoding enabled boolean'), | 57 | body('transcoding.webtorrent.enabled').isBoolean().withMessage('Should have a valid webtorrent transcoding enabled boolean'), |
58 | body('transcoding.hls.enabled').isBoolean().withMessage('Should have a valid hls transcoding enabled boolean'), | 58 | body('transcoding.hls.enabled').isBoolean().withMessage('Should have a valid hls transcoding enabled boolean'), |
59 | 59 | ||
60 | body('videoEditor.enabled').isBoolean().withMessage('Should have a valid video editor enabled boolean'), | 60 | body('videoStudio.enabled').isBoolean().withMessage('Should have a valid video studio enabled boolean'), |
61 | 61 | ||
62 | body('import.videos.concurrency').isInt({ min: 0 }).withMessage('Should have a valid import concurrency number'), | 62 | body('import.videos.concurrency').isInt({ min: 0 }).withMessage('Should have a valid import concurrency number'), |
63 | body('import.videos.http.enabled').isBoolean().withMessage('Should have a valid import video http enabled boolean'), | 63 | body('import.videos.http.enabled').isBoolean().withMessage('Should have a valid import video http enabled boolean'), |
@@ -106,7 +106,7 @@ const customConfigUpdateValidator = [ | |||
106 | if (!checkInvalidConfigIfEmailDisabled(req.body, res)) return | 106 | if (!checkInvalidConfigIfEmailDisabled(req.body, res)) return |
107 | if (!checkInvalidTranscodingConfig(req.body, res)) return | 107 | if (!checkInvalidTranscodingConfig(req.body, res)) return |
108 | if (!checkInvalidLiveConfig(req.body, res)) return | 108 | if (!checkInvalidLiveConfig(req.body, res)) return |
109 | if (!checkInvalidVideoEditorConfig(req.body, res)) return | 109 | if (!checkInvalidVideoStudioConfig(req.body, res)) return |
110 | 110 | ||
111 | return next() | 111 | return next() |
112 | } | 112 | } |
@@ -163,11 +163,11 @@ function checkInvalidLiveConfig (customConfig: CustomConfig, res: express.Respon | |||
163 | return true | 163 | return true |
164 | } | 164 | } |
165 | 165 | ||
166 | function checkInvalidVideoEditorConfig (customConfig: CustomConfig, res: express.Response) { | 166 | function checkInvalidVideoStudioConfig (customConfig: CustomConfig, res: express.Response) { |
167 | if (customConfig.videoEditor.enabled === false) return true | 167 | if (customConfig.videoStudio.enabled === false) return true |
168 | 168 | ||
169 | if (customConfig.videoEditor.enabled === true && customConfig.transcoding.enabled === false) { | 169 | if (customConfig.videoStudio.enabled === true && customConfig.transcoding.enabled === false) { |
170 | res.fail({ message: 'You cannot enable video editor if transcoding is not enabled' }) | 170 | res.fail({ message: 'You cannot enable video studio if transcoding is not enabled' }) |
171 | return false | 171 | return false |
172 | } | 172 | } |
173 | 173 | ||
diff --git a/server/middlewares/validators/videos/index.ts b/server/middlewares/validators/videos/index.ts index faa082510..c7dea4b3d 100644 --- a/server/middlewares/validators/videos/index.ts +++ b/server/middlewares/validators/videos/index.ts | |||
@@ -2,7 +2,6 @@ export * from './video-blacklist' | |||
2 | export * from './video-captions' | 2 | export * from './video-captions' |
3 | export * from './video-channels' | 3 | export * from './video-channels' |
4 | export * from './video-comments' | 4 | export * from './video-comments' |
5 | export * from './video-editor' | ||
6 | export * from './video-files' | 5 | export * from './video-files' |
7 | export * from './video-imports' | 6 | export * from './video-imports' |
8 | export * from './video-live' | 7 | export * from './video-live' |
@@ -10,5 +9,6 @@ export * from './video-ownership-changes' | |||
10 | export * from './video-watch' | 9 | export * from './video-watch' |
11 | export * from './video-rates' | 10 | export * from './video-rates' |
12 | export * from './video-shares' | 11 | export * from './video-shares' |
12 | export * from './video-studio' | ||
13 | export * from './video-transcoding' | 13 | export * from './video-transcoding' |
14 | export * from './videos' | 14 | export * from './videos' |
diff --git a/server/middlewares/validators/videos/video-editor.ts b/server/middlewares/validators/videos/video-studio.ts index 9be97be93..af7fe2283 100644 --- a/server/middlewares/validators/videos/video-editor.ts +++ b/server/middlewares/validators/videos/video-studio.ts | |||
@@ -2,31 +2,31 @@ import express from 'express' | |||
2 | import { body, param } from 'express-validator' | 2 | import { body, param } from 'express-validator' |
3 | import { isIdOrUUIDValid } from '@server/helpers/custom-validators/misc' | 3 | import { isIdOrUUIDValid } from '@server/helpers/custom-validators/misc' |
4 | import { | 4 | import { |
5 | isEditorCutTaskValid, | 5 | isStudioCutTaskValid, |
6 | isEditorTaskAddIntroOutroValid, | 6 | isStudioTaskAddIntroOutroValid, |
7 | isEditorTaskAddWatermarkValid, | 7 | isStudioTaskAddWatermarkValid, |
8 | isValidEditorTasksArray | 8 | isValidStudioTasksArray |
9 | } from '@server/helpers/custom-validators/video-editor' | 9 | } from '@server/helpers/custom-validators/video-studio' |
10 | import { cleanUpReqFiles } from '@server/helpers/express-utils' | 10 | import { cleanUpReqFiles } from '@server/helpers/express-utils' |
11 | import { CONFIG } from '@server/initializers/config' | 11 | import { CONFIG } from '@server/initializers/config' |
12 | import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-editor' | 12 | import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-studio' |
13 | import { isAudioFile } from '@shared/extra-utils' | 13 | import { isAudioFile } from '@shared/extra-utils' |
14 | import { HttpStatusCode, UserRight, VideoEditorCreateEdition, VideoEditorTask, VideoState } from '@shared/models' | 14 | import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' |
15 | import { logger } from '../../../helpers/logger' | 15 | import { logger } from '../../../helpers/logger' |
16 | import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' | 16 | import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' |
17 | 17 | ||
18 | const videosEditorAddEditionValidator = [ | 18 | const videoStudioAddEditionValidator = [ |
19 | param('videoId').custom(isIdOrUUIDValid).withMessage('Should have a valid video id/uuid'), | 19 | param('videoId').custom(isIdOrUUIDValid).withMessage('Should have a valid video id/uuid'), |
20 | 20 | ||
21 | body('tasks').custom(isValidEditorTasksArray).withMessage('Should have a valid array of tasks'), | 21 | body('tasks').custom(isValidStudioTasksArray).withMessage('Should have a valid array of tasks'), |
22 | 22 | ||
23 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 23 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
24 | logger.debug('Checking videosEditorAddEditionValidator parameters.', { parameters: req.params, body: req.body, files: req.files }) | 24 | logger.debug('Checking videoStudioAddEditionValidator parameters.', { parameters: req.params, body: req.body, files: req.files }) |
25 | 25 | ||
26 | if (CONFIG.VIDEO_EDITOR.ENABLED !== true) { | 26 | if (CONFIG.VIDEO_STUDIO.ENABLED !== true) { |
27 | res.fail({ | 27 | res.fail({ |
28 | status: HttpStatusCode.BAD_REQUEST_400, | 28 | status: HttpStatusCode.BAD_REQUEST_400, |
29 | message: 'Video editor is disabled on this instance' | 29 | message: 'Video studio is disabled on this instance' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | return cleanUpReqFiles(req) | 32 | return cleanUpReqFiles(req) |
@@ -34,7 +34,7 @@ const videosEditorAddEditionValidator = [ | |||
34 | 34 | ||
35 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) | 35 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) |
36 | 36 | ||
37 | const body: VideoEditorCreateEdition = req.body | 37 | const body: VideoStudioCreateEdition = req.body |
38 | const files = req.files as Express.Multer.File[] | 38 | const files = req.files as Express.Multer.File[] |
39 | 39 | ||
40 | for (let i = 0; i < body.tasks.length; i++) { | 40 | for (let i = 0; i < body.tasks.length; i++) { |
@@ -90,21 +90,21 @@ const videosEditorAddEditionValidator = [ | |||
90 | // --------------------------------------------------------------------------- | 90 | // --------------------------------------------------------------------------- |
91 | 91 | ||
92 | export { | 92 | export { |
93 | videosEditorAddEditionValidator | 93 | videoStudioAddEditionValidator |
94 | } | 94 | } |
95 | 95 | ||
96 | // --------------------------------------------------------------------------- | 96 | // --------------------------------------------------------------------------- |
97 | 97 | ||
98 | const taskCheckers: { | 98 | const taskCheckers: { |
99 | [id in VideoEditorTask['name']]: (task: VideoEditorTask, indice?: number, files?: Express.Multer.File[]) => boolean | 99 | [id in VideoStudioTask['name']]: (task: VideoStudioTask, indice?: number, files?: Express.Multer.File[]) => boolean |
100 | } = { | 100 | } = { |
101 | 'cut': isEditorCutTaskValid, | 101 | 'cut': isStudioCutTaskValid, |
102 | 'add-intro': isEditorTaskAddIntroOutroValid, | 102 | 'add-intro': isStudioTaskAddIntroOutroValid, |
103 | 'add-outro': isEditorTaskAddIntroOutroValid, | 103 | 'add-outro': isStudioTaskAddIntroOutroValid, |
104 | 'add-watermark': isEditorTaskAddWatermarkValid | 104 | 'add-watermark': isStudioTaskAddWatermarkValid |
105 | } | 105 | } |
106 | 106 | ||
107 | function checkTask (req: express.Request, task: VideoEditorTask, indice?: number) { | 107 | function checkTask (req: express.Request, task: VideoStudioTask, indice?: number) { |
108 | const checker = taskCheckers[task.name] | 108 | const checker = taskCheckers[task.name] |
109 | if (!checker) return false | 109 | if (!checker) return false |
110 | 110 | ||
diff --git a/server/models/user/user-notification-setting.ts b/server/models/user/user-notification-setting.ts index b144f8377..66e1d85b3 100644 --- a/server/models/user/user-notification-setting.ts +++ b/server/models/user/user-notification-setting.ts | |||
@@ -178,11 +178,11 @@ export class UserNotificationSettingModel extends Model<Partial<AttributesOnly<U | |||
178 | @AllowNull(false) | 178 | @AllowNull(false) |
179 | @Default(null) | 179 | @Default(null) |
180 | @Is( | 180 | @Is( |
181 | 'UserNotificationSettingMyVideoEditionFinished', | 181 | 'UserNotificationSettingMyVideoStudioEditionFinished', |
182 | value => throwIfNotValid(value, isUserNotificationSettingValid, 'myVideoEditionFinished') | 182 | value => throwIfNotValid(value, isUserNotificationSettingValid, 'myVideoStudioEditionFinished') |
183 | ) | 183 | ) |
184 | @Column | 184 | @Column |
185 | myVideoEditionFinished: UserNotificationSettingValue | 185 | myVideoStudioEditionFinished: UserNotificationSettingValue |
186 | 186 | ||
187 | @ForeignKey(() => UserModel) | 187 | @ForeignKey(() => UserModel) |
188 | @Column | 188 | @Column |
@@ -225,7 +225,7 @@ export class UserNotificationSettingModel extends Model<Partial<AttributesOnly<U | |||
225 | abuseNewMessage: this.abuseNewMessage, | 225 | abuseNewMessage: this.abuseNewMessage, |
226 | abuseStateChange: this.abuseStateChange, | 226 | abuseStateChange: this.abuseStateChange, |
227 | newPeerTubeVersion: this.newPeerTubeVersion, | 227 | newPeerTubeVersion: this.newPeerTubeVersion, |
228 | myVideoEditionFinished: this.myVideoEditionFinished, | 228 | myVideoStudioEditionFinished: this.myVideoStudioEditionFinished, |
229 | newPluginVersion: this.newPluginVersion | 229 | newPluginVersion: this.newPluginVersion |
230 | } | 230 | } |
231 | } | 231 | } |
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 900f642c2..c8dbbf797 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -148,7 +148,7 @@ describe('Test config API validators', function () { | |||
148 | } | 148 | } |
149 | } | 149 | } |
150 | }, | 150 | }, |
151 | videoEditor: { | 151 | videoStudio: { |
152 | enabled: true | 152 | enabled: true |
153 | }, | 153 | }, |
154 | import: { | 154 | import: { |
diff --git a/server/tests/api/check-params/index.ts b/server/tests/api/check-params/index.ts index c088b52cd..c9adeef4a 100644 --- a/server/tests/api/check-params/index.ts +++ b/server/tests/api/check-params/index.ts | |||
@@ -25,7 +25,7 @@ import './video-blacklist' | |||
25 | import './video-captions' | 25 | import './video-captions' |
26 | import './video-channels' | 26 | import './video-channels' |
27 | import './video-comments' | 27 | import './video-comments' |
28 | import './video-editor' | 28 | import './video-studio' |
29 | import './video-imports' | 29 | import './video-imports' |
30 | import './video-playlists' | 30 | import './video-playlists' |
31 | import './videos' | 31 | import './videos' |
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts index 93355e8b3..7fbe4271b 100644 --- a/server/tests/api/check-params/user-notifications.ts +++ b/server/tests/api/check-params/user-notifications.ts | |||
@@ -171,7 +171,7 @@ describe('Test user notifications API validators', function () { | |||
171 | abuseNewMessage: UserNotificationSettingValue.WEB, | 171 | abuseNewMessage: UserNotificationSettingValue.WEB, |
172 | abuseStateChange: UserNotificationSettingValue.WEB, | 172 | abuseStateChange: UserNotificationSettingValue.WEB, |
173 | newPeerTubeVersion: UserNotificationSettingValue.WEB, | 173 | newPeerTubeVersion: UserNotificationSettingValue.WEB, |
174 | myVideoEditionFinished: UserNotificationSettingValue.WEB, | 174 | myVideoStudioEditionFinished: UserNotificationSettingValue.WEB, |
175 | newPluginVersion: UserNotificationSettingValue.WEB | 175 | newPluginVersion: UserNotificationSettingValue.WEB |
176 | } | 176 | } |
177 | 177 | ||
diff --git a/server/tests/api/check-params/video-editor.ts b/server/tests/api/check-params/video-studio.ts index 5f5faf8fb..9ca55d095 100644 --- a/server/tests/api/check-params/video-editor.ts +++ b/server/tests/api/check-params/video-studio.ts | |||
@@ -1,19 +1,19 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode, VideoEditorTask } from '@shared/models' | 4 | import { HttpStatusCode, VideoStudioTask } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | createSingleServer, | 7 | createSingleServer, |
8 | PeerTubeServer, | 8 | PeerTubeServer, |
9 | setAccessTokensToServers, | 9 | setAccessTokensToServers, |
10 | VideoEditorCommand, | 10 | VideoStudioCommand, |
11 | waitJobs | 11 | waitJobs |
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | 13 | ||
14 | describe('Test video editor API validator', function () { | 14 | describe('Test video studio API validator', function () { |
15 | let server: PeerTubeServer | 15 | let server: PeerTubeServer |
16 | let command: VideoEditorCommand | 16 | let command: VideoStudioCommand |
17 | let userAccessToken: string | 17 | let userAccessToken: string |
18 | let videoUUID: string | 18 | let videoUUID: string |
19 | 19 | ||
@@ -32,7 +32,7 @@ describe('Test video editor API validator', function () { | |||
32 | const { uuid } = await server.videos.quickUpload({ name: 'video' }) | 32 | const { uuid } = await server.videos.quickUpload({ name: 'video' }) |
33 | videoUUID = uuid | 33 | videoUUID = uuid |
34 | 34 | ||
35 | command = server.videoEditor | 35 | command = server.videoStudio |
36 | 36 | ||
37 | await waitJobs([ server ]) | 37 | await waitJobs([ server ]) |
38 | }) | 38 | }) |
@@ -41,10 +41,10 @@ describe('Test video editor API validator', function () { | |||
41 | 41 | ||
42 | describe('Config settings', function () { | 42 | describe('Config settings', function () { |
43 | 43 | ||
44 | it('Should fail if editor is disabled', async function () { | 44 | it('Should fail if studio is disabled', async function () { |
45 | await server.config.updateExistingSubConfig({ | 45 | await server.config.updateExistingSubConfig({ |
46 | newConfig: { | 46 | newConfig: { |
47 | videoEditor: { | 47 | videoStudio: { |
48 | enabled: false | 48 | enabled: false |
49 | } | 49 | } |
50 | } | 50 | } |
@@ -52,15 +52,15 @@ describe('Test video editor API validator', function () { | |||
52 | 52 | ||
53 | await command.createEditionTasks({ | 53 | await command.createEditionTasks({ |
54 | videoId: videoUUID, | 54 | videoId: videoUUID, |
55 | tasks: VideoEditorCommand.getComplexTask(), | 55 | tasks: VideoStudioCommand.getComplexTask(), |
56 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | 56 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
57 | }) | 57 | }) |
58 | }) | 58 | }) |
59 | 59 | ||
60 | it('Should fail to enable editor if transcoding is disabled', async function () { | 60 | it('Should fail to enable studio if transcoding is disabled', async function () { |
61 | await server.config.updateExistingSubConfig({ | 61 | await server.config.updateExistingSubConfig({ |
62 | newConfig: { | 62 | newConfig: { |
63 | videoEditor: { | 63 | videoStudio: { |
64 | enabled: true | 64 | enabled: true |
65 | }, | 65 | }, |
66 | transcoding: { | 66 | transcoding: { |
@@ -71,10 +71,10 @@ describe('Test video editor API validator', function () { | |||
71 | }) | 71 | }) |
72 | }) | 72 | }) |
73 | 73 | ||
74 | it('Should succeed to enable video editor', async function () { | 74 | it('Should succeed to enable video studio', async function () { |
75 | await server.config.updateExistingSubConfig({ | 75 | await server.config.updateExistingSubConfig({ |
76 | newConfig: { | 76 | newConfig: { |
77 | videoEditor: { | 77 | videoStudio: { |
78 | enabled: true | 78 | enabled: true |
79 | }, | 79 | }, |
80 | transcoding: { | 80 | transcoding: { |
@@ -91,7 +91,7 @@ describe('Test video editor API validator', function () { | |||
91 | await command.createEditionTasks({ | 91 | await command.createEditionTasks({ |
92 | token: null, | 92 | token: null, |
93 | videoId: videoUUID, | 93 | videoId: videoUUID, |
94 | tasks: VideoEditorCommand.getComplexTask(), | 94 | tasks: VideoStudioCommand.getComplexTask(), |
95 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 | 95 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 |
96 | }) | 96 | }) |
97 | }) | 97 | }) |
@@ -100,7 +100,7 @@ describe('Test video editor API validator', function () { | |||
100 | await command.createEditionTasks({ | 100 | await command.createEditionTasks({ |
101 | token: userAccessToken, | 101 | token: userAccessToken, |
102 | videoId: videoUUID, | 102 | videoId: videoUUID, |
103 | tasks: VideoEditorCommand.getComplexTask(), | 103 | tasks: VideoStudioCommand.getComplexTask(), |
104 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | 104 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
105 | }) | 105 | }) |
106 | }) | 106 | }) |
@@ -108,7 +108,7 @@ describe('Test video editor API validator', function () { | |||
108 | it('Should fail with an invalid video', async function () { | 108 | it('Should fail with an invalid video', async function () { |
109 | await command.createEditionTasks({ | 109 | await command.createEditionTasks({ |
110 | videoId: 'tintin', | 110 | videoId: 'tintin', |
111 | tasks: VideoEditorCommand.getComplexTask(), | 111 | tasks: VideoStudioCommand.getComplexTask(), |
112 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | 112 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
113 | }) | 113 | }) |
114 | }) | 114 | }) |
@@ -116,7 +116,7 @@ describe('Test video editor API validator', function () { | |||
116 | it('Should fail with an unknown video', async function () { | 116 | it('Should fail with an unknown video', async function () { |
117 | await command.createEditionTasks({ | 117 | await command.createEditionTasks({ |
118 | videoId: 42, | 118 | videoId: 42, |
119 | tasks: VideoEditorCommand.getComplexTask(), | 119 | tasks: VideoStudioCommand.getComplexTask(), |
120 | expectedStatus: HttpStatusCode.NOT_FOUND_404 | 120 | expectedStatus: HttpStatusCode.NOT_FOUND_404 |
121 | }) | 121 | }) |
122 | }) | 122 | }) |
@@ -132,7 +132,7 @@ describe('Test video editor API validator', function () { | |||
132 | 132 | ||
133 | await command.createEditionTasks({ | 133 | await command.createEditionTasks({ |
134 | videoId: uuid, | 134 | videoId: uuid, |
135 | tasks: VideoEditorCommand.getComplexTask(), | 135 | tasks: VideoStudioCommand.getComplexTask(), |
136 | expectedStatus: HttpStatusCode.CONFLICT_409 | 136 | expectedStatus: HttpStatusCode.CONFLICT_409 |
137 | }) | 137 | }) |
138 | 138 | ||
@@ -171,7 +171,7 @@ describe('Test video editor API validator', function () { | |||
171 | }) | 171 | }) |
172 | 172 | ||
173 | it('Should fail with too many tasks', async function () { | 173 | it('Should fail with too many tasks', async function () { |
174 | const tasks: VideoEditorTask[] = [] | 174 | const tasks: VideoStudioTask[] = [] |
175 | 175 | ||
176 | for (let i = 0; i < 110; i++) { | 176 | for (let i = 0; i < 110; i++) { |
177 | tasks.push({ | 177 | tasks.push({ |
@@ -194,7 +194,7 @@ describe('Test video editor API validator', function () { | |||
194 | 194 | ||
195 | await command.createEditionTasks({ | 195 | await command.createEditionTasks({ |
196 | videoId: videoUUID, | 196 | videoId: videoUUID, |
197 | tasks: VideoEditorCommand.getComplexTask(), | 197 | tasks: VideoStudioCommand.getComplexTask(), |
198 | expectedStatus: HttpStatusCode.NO_CONTENT_204 | 198 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
199 | }) | 199 | }) |
200 | }) | 200 | }) |
@@ -204,7 +204,7 @@ describe('Test video editor API validator', function () { | |||
204 | 204 | ||
205 | await command.createEditionTasks({ | 205 | await command.createEditionTasks({ |
206 | videoId: videoUUID, | 206 | videoId: videoUUID, |
207 | tasks: VideoEditorCommand.getComplexTask(), | 207 | tasks: VideoStudioCommand.getComplexTask(), |
208 | expectedStatus: HttpStatusCode.CONFLICT_409 | 208 | expectedStatus: HttpStatusCode.CONFLICT_409 |
209 | }) | 209 | }) |
210 | 210 | ||
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts index c87686cb5..47e85a30c 100644 --- a/server/tests/api/notifications/user-notifications.ts +++ b/server/tests/api/notifications/user-notifications.ts | |||
@@ -7,7 +7,7 @@ import { | |||
7 | checkMyVideoImportIsFinished, | 7 | checkMyVideoImportIsFinished, |
8 | checkNewActorFollow, | 8 | checkNewActorFollow, |
9 | checkNewVideoFromSubscription, | 9 | checkNewVideoFromSubscription, |
10 | checkVideoEditionIsFinished, | 10 | checkVideoStudioEditionIsFinished, |
11 | checkVideoIsPublished, | 11 | checkVideoIsPublished, |
12 | FIXTURE_URLS, | 12 | FIXTURE_URLS, |
13 | MockSmtpServer, | 13 | MockSmtpServer, |
@@ -16,7 +16,7 @@ import { | |||
16 | } from '@server/tests/shared' | 16 | } from '@server/tests/shared' |
17 | import { wait } from '@shared/core-utils' | 17 | import { wait } from '@shared/core-utils' |
18 | import { buildUUID } from '@shared/extra-utils' | 18 | import { buildUUID } from '@shared/extra-utils' |
19 | import { UserNotification, UserNotificationType, VideoEditorTask, VideoPrivacy } from '@shared/models' | 19 | import { UserNotification, UserNotificationType, VideoStudioTask, VideoPrivacy } from '@shared/models' |
20 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' | 20 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' |
21 | 21 | ||
22 | const expect = chai.expect | 22 | const expect = chai.expect |
@@ -323,7 +323,7 @@ describe('Test user notifications', function () { | |||
323 | }) | 323 | }) |
324 | }) | 324 | }) |
325 | 325 | ||
326 | describe('Video editor', function () { | 326 | describe('Video studio', function () { |
327 | let baseParams: CheckerBaseParams | 327 | let baseParams: CheckerBaseParams |
328 | 328 | ||
329 | before(() => { | 329 | before(() => { |
@@ -335,7 +335,7 @@ describe('Test user notifications', function () { | |||
335 | } | 335 | } |
336 | }) | 336 | }) |
337 | 337 | ||
338 | it('Should send a notification after editor edition', async function () { | 338 | it('Should send a notification after studio edition', async function () { |
339 | this.timeout(240000) | 339 | this.timeout(240000) |
340 | 340 | ||
341 | const { name, shortUUID, id } = await uploadRandomVideoOnServers(servers, 2, { waitTranscoding: true }) | 341 | const { name, shortUUID, id } = await uploadRandomVideoOnServers(servers, 2, { waitTranscoding: true }) |
@@ -343,7 +343,7 @@ describe('Test user notifications', function () { | |||
343 | await waitJobs(servers) | 343 | await waitJobs(servers) |
344 | await checkVideoIsPublished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' }) | 344 | await checkVideoIsPublished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' }) |
345 | 345 | ||
346 | const tasks: VideoEditorTask[] = [ | 346 | const tasks: VideoStudioTask[] = [ |
347 | { | 347 | { |
348 | name: 'cut', | 348 | name: 'cut', |
349 | options: { | 349 | options: { |
@@ -352,10 +352,10 @@ describe('Test user notifications', function () { | |||
352 | } | 352 | } |
353 | } | 353 | } |
354 | ] | 354 | ] |
355 | await servers[1].videoEditor.createEditionTasks({ videoId: id, tasks }) | 355 | await servers[1].videoStudio.createEditionTasks({ videoId: id, tasks }) |
356 | await waitJobs(servers) | 356 | await waitJobs(servers) |
357 | 357 | ||
358 | await checkVideoEditionIsFinished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' }) | 358 | await checkVideoStudioEditionIsFinished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' }) |
359 | }) | 359 | }) |
360 | }) | 360 | }) |
361 | 361 | ||
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 5028b65e6..f31012a5c 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -98,7 +98,7 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { | |||
98 | expect(data.live.transcoding.resolutions['1440p']).to.be.false | 98 | expect(data.live.transcoding.resolutions['1440p']).to.be.false |
99 | expect(data.live.transcoding.resolutions['2160p']).to.be.false | 99 | expect(data.live.transcoding.resolutions['2160p']).to.be.false |
100 | 100 | ||
101 | expect(data.videoEditor.enabled).to.be.false | 101 | expect(data.videoStudio.enabled).to.be.false |
102 | 102 | ||
103 | expect(data.import.videos.concurrency).to.equal(2) | 103 | expect(data.import.videos.concurrency).to.equal(2) |
104 | expect(data.import.videos.http.enabled).to.be.true | 104 | expect(data.import.videos.http.enabled).to.be.true |
@@ -201,7 +201,7 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
201 | expect(data.live.transcoding.resolutions['1080p']).to.be.true | 201 | expect(data.live.transcoding.resolutions['1080p']).to.be.true |
202 | expect(data.live.transcoding.resolutions['2160p']).to.be.true | 202 | expect(data.live.transcoding.resolutions['2160p']).to.be.true |
203 | 203 | ||
204 | expect(data.videoEditor.enabled).to.be.true | 204 | expect(data.videoStudio.enabled).to.be.true |
205 | 205 | ||
206 | expect(data.import.videos.concurrency).to.equal(4) | 206 | expect(data.import.videos.concurrency).to.equal(4) |
207 | expect(data.import.videos.http.enabled).to.be.false | 207 | expect(data.import.videos.http.enabled).to.be.false |
@@ -350,7 +350,7 @@ const newCustomConfig: CustomConfig = { | |||
350 | } | 350 | } |
351 | } | 351 | } |
352 | }, | 352 | }, |
353 | videoEditor: { | 353 | videoStudio: { |
354 | enabled: true | 354 | enabled: true |
355 | }, | 355 | }, |
356 | import: { | 356 | import: { |
diff --git a/server/tests/api/transcoding/index.ts b/server/tests/api/transcoding/index.ts index 8a0a1d787..0cc28b4a4 100644 --- a/server/tests/api/transcoding/index.ts +++ b/server/tests/api/transcoding/index.ts | |||
@@ -2,4 +2,4 @@ export * from './audio-only' | |||
2 | export * from './create-transcoding' | 2 | export * from './create-transcoding' |
3 | export * from './hls' | 3 | export * from './hls' |
4 | export * from './transcoder' | 4 | export * from './transcoder' |
5 | export * from './video-editor' | 5 | export * from './video-studio' |
diff --git a/server/tests/api/transcoding/video-editor.ts b/server/tests/api/transcoding/video-studio.ts index f70bd49e6..ac1c0fc7e 100644 --- a/server/tests/api/transcoding/video-editor.ts +++ b/server/tests/api/transcoding/video-studio.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import { expectStartWith, getAllFiles } from '@server/tests/shared' | 2 | import { expectStartWith, getAllFiles } from '@server/tests/shared' |
3 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 3 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
4 | import { VideoEditorTask } from '@shared/models' | 4 | import { VideoStudioTask } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | createMultipleServers, | 7 | createMultipleServers, |
@@ -10,11 +10,11 @@ import { | |||
10 | PeerTubeServer, | 10 | PeerTubeServer, |
11 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
12 | setDefaultVideoChannel, | 12 | setDefaultVideoChannel, |
13 | VideoEditorCommand, | 13 | VideoStudioCommand, |
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | describe('Test video editor', function () { | 17 | describe('Test video studio', function () { |
18 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
19 | let videoUUID: string | 19 | let videoUUID: string |
20 | 20 | ||
@@ -39,8 +39,8 @@ describe('Test video editor', function () { | |||
39 | await waitJobs(servers) | 39 | await waitJobs(servers) |
40 | } | 40 | } |
41 | 41 | ||
42 | async function createTasks (tasks: VideoEditorTask[]) { | 42 | async function createTasks (tasks: VideoStudioTask[]) { |
43 | await servers[0].videoEditor.createEditionTasks({ videoId: videoUUID, tasks }) | 43 | await servers[0].videoStudio.createEditionTasks({ videoId: videoUUID, tasks }) |
44 | await waitJobs(servers) | 44 | await waitJobs(servers) |
45 | } | 45 | } |
46 | 46 | ||
@@ -56,7 +56,7 @@ describe('Test video editor', function () { | |||
56 | 56 | ||
57 | await servers[0].config.enableMinimumTranscoding() | 57 | await servers[0].config.enableMinimumTranscoding() |
58 | 58 | ||
59 | await servers[0].config.enableEditor() | 59 | await servers[0].config.enableStudio() |
60 | }) | 60 | }) |
61 | 61 | ||
62 | describe('Cutting', function () { | 62 | describe('Cutting', function () { |
@@ -276,7 +276,7 @@ describe('Test video editor', function () { | |||
276 | this.timeout(240_000) | 276 | this.timeout(240_000) |
277 | await renewVideo() | 277 | await renewVideo() |
278 | 278 | ||
279 | await createTasks(VideoEditorCommand.getComplexTask()) | 279 | await createTasks(VideoStudioCommand.getComplexTask()) |
280 | 280 | ||
281 | for (const server of servers) { | 281 | for (const server of servers) { |
282 | await checkDuration(server, 9) | 282 | await checkDuration(server, 9) |
@@ -303,7 +303,7 @@ describe('Test video editor', function () { | |||
303 | this.timeout(240_000) | 303 | this.timeout(240_000) |
304 | await renewVideo() | 304 | await renewVideo() |
305 | 305 | ||
306 | await createTasks(VideoEditorCommand.getComplexTask()) | 306 | await createTasks(VideoStudioCommand.getComplexTask()) |
307 | 307 | ||
308 | for (const server of servers) { | 308 | for (const server of servers) { |
309 | const video = await server.videos.get({ id: videoUUID }) | 309 | const video = await server.videos.get({ id: videoUUID }) |
@@ -333,7 +333,7 @@ describe('Test video editor', function () { | |||
333 | const video = await servers[0].videos.get({ id: videoUUID }) | 333 | const video = await servers[0].videos.get({ id: videoUUID }) |
334 | const oldFileUrls = getAllFiles(video).map(f => f.fileUrl) | 334 | const oldFileUrls = getAllFiles(video).map(f => f.fileUrl) |
335 | 335 | ||
336 | await createTasks(VideoEditorCommand.getComplexTask()) | 336 | await createTasks(VideoStudioCommand.getComplexTask()) |
337 | 337 | ||
338 | for (const server of servers) { | 338 | for (const server of servers) { |
339 | const video = await server.videos.get({ id: videoUUID }) | 339 | const video = await server.videos.get({ id: videoUUID }) |
diff --git a/server/tests/shared/notifications.ts b/server/tests/shared/notifications.ts index f1ddbbbf7..2a69a09de 100644 --- a/server/tests/shared/notifications.ts +++ b/server/tests/shared/notifications.ts | |||
@@ -47,7 +47,7 @@ function getAllNotificationsSettings (): UserNotificationSetting { | |||
47 | abuseStateChange: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, | 47 | abuseStateChange: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, |
48 | autoInstanceFollowing: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, | 48 | autoInstanceFollowing: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, |
49 | newPeerTubeVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, | 49 | newPeerTubeVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, |
50 | myVideoEditionFinished: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, | 50 | myVideoStudioEditionFinished: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, |
51 | newPluginVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL | 51 | newPluginVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL |
52 | } | 52 | } |
53 | } | 53 | } |
@@ -110,13 +110,13 @@ async function checkVideoIsPublished (options: CheckerBaseParams & { | |||
110 | await checkNotification({ ...options, notificationChecker, emailNotificationFinder }) | 110 | await checkNotification({ ...options, notificationChecker, emailNotificationFinder }) |
111 | } | 111 | } |
112 | 112 | ||
113 | async function checkVideoEditionIsFinished (options: CheckerBaseParams & { | 113 | async function checkVideoStudioEditionIsFinished (options: CheckerBaseParams & { |
114 | videoName: string | 114 | videoName: string |
115 | shortUUID: string | 115 | shortUUID: string |
116 | checkType: CheckerType | 116 | checkType: CheckerType |
117 | }) { | 117 | }) { |
118 | const { videoName, shortUUID } = options | 118 | const { videoName, shortUUID } = options |
119 | const notificationType = UserNotificationType.MY_VIDEO_EDITION_FINISHED | 119 | const notificationType = UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED |
120 | 120 | ||
121 | function notificationChecker (notification: UserNotification, checkType: CheckerType) { | 121 | function notificationChecker (notification: UserNotification, checkType: CheckerType) { |
122 | if (checkType === 'presence') { | 122 | if (checkType === 'presence') { |
@@ -685,7 +685,7 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an | |||
685 | await setDefaultChannelAvatar(servers) | 685 | await setDefaultChannelAvatar(servers) |
686 | await setDefaultAccountAvatar(servers) | 686 | await setDefaultAccountAvatar(servers) |
687 | 687 | ||
688 | await servers[1].config.enableEditor() | 688 | await servers[1].config.enableStudio() |
689 | 689 | ||
690 | if (serversCount > 1) { | 690 | if (serversCount > 1) { |
691 | await doubleFollow(servers[0], servers[1]) | 691 | await doubleFollow(servers[0], servers[1]) |
@@ -756,7 +756,7 @@ export { | |||
756 | checkNewAccountAbuseForModerators, | 756 | checkNewAccountAbuseForModerators, |
757 | checkNewPeerTubeVersion, | 757 | checkNewPeerTubeVersion, |
758 | checkNewPluginVersion, | 758 | checkNewPluginVersion, |
759 | checkVideoEditionIsFinished | 759 | checkVideoStudioEditionIsFinished |
760 | } | 760 | } |
761 | 761 | ||
762 | // --------------------------------------------------------------------------- | 762 | // --------------------------------------------------------------------------- |