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/controllers/api | |
parent | 1808a1f8e4b7b102823492a2007a46929aebf189 (diff) | |
download | PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.gz PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.tar.zst PeerTube-92e66e04f7f51d37b465cff442ce47f6d6d7cadd.zip |
Rename studio to editor
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/config.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/users/my-notifications.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/studio.ts (renamed from server/controllers/api/videos/editor.ts) | 44 |
4 files changed, 27 insertions, 27 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: { |