aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html12
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts4
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts4
-rw-r--r--client/src/app/+my-library/my-videos/my-videos.component.ts6
-rw-r--r--client/src/app/+video-editor/edit/index.ts2
-rw-r--r--client/src/app/+video-editor/index.ts1
-rw-r--r--client/src/app/+video-editor/shared/index.ts1
-rw-r--r--client/src/app/+video-editor/video-editor-routing.module.ts30
-rw-r--r--client/src/app/+video-editor/video-editor.module.ts27
-rw-r--r--client/src/app/+video-studio/edit/index.ts2
-rw-r--r--client/src/app/+video-studio/edit/video-studio-edit.component.html (renamed from client/src/app/+video-editor/edit/video-editor-edit.component.html)2
-rw-r--r--client/src/app/+video-studio/edit/video-studio-edit.component.scss (renamed from client/src/app/+video-editor/edit/video-editor-edit.component.scss)0
-rw-r--r--client/src/app/+video-studio/edit/video-studio-edit.component.ts (renamed from client/src/app/+video-editor/edit/video-editor-edit.component.ts)28
-rw-r--r--client/src/app/+video-studio/edit/video-studio-edit.resolver.ts (renamed from client/src/app/+video-editor/edit/video-editor-edit.resolver.ts)2
-rw-r--r--client/src/app/+video-studio/index.ts1
-rw-r--r--client/src/app/+video-studio/shared/index.ts1
-rw-r--r--client/src/app/+video-studio/shared/video-studio.service.ts (renamed from client/src/app/+video-editor/shared/video-editor.service.ts)10
-rw-r--r--client/src/app/+video-studio/video-studio-routing.module.ts29
-rw-r--r--client/src/app/+video-studio/video-studio.module.ts27
-rw-r--r--client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.ts2
-rw-r--r--client/src/app/app-routing.module.ts4
-rw-r--r--client/src/app/shared/shared-main/users/user-notification.model.ts2
-rw-r--r--client/src/app/shared/shared-main/users/user-notifications.component.html2
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts4
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts12
-rw-r--r--config/default.yaml2
-rw-r--r--config/production.yaml.example2
-rw-r--r--config/test-1.yaml2
-rw-r--r--config/test-3.yaml2
-rw-r--r--config/test-4.yaml2
-rw-r--r--config/test-5.yaml2
-rw-r--r--config/test-6.yaml2
-rw-r--r--config/test.yaml2
-rw-r--r--server/controllers/api/config.ts4
-rw-r--r--server/controllers/api/users/my-notifications.ts2
-rw-r--r--server/controllers/api/videos/index.ts4
-rw-r--r--server/controllers/api/videos/studio.ts (renamed from server/controllers/api/videos/editor.ts)44
-rw-r--r--server/helpers/custom-validators/video-studio.ts (renamed from server/helpers/custom-validators/video-editor.ts)28
-rw-r--r--server/initializers/checker-after-init.ts8
-rw-r--r--server/initializers/checker-before-init.ts2
-rw-r--r--server/initializers/config.ts4
-rw-r--r--server/initializers/constants.ts8
-rw-r--r--server/initializers/migrations/0700-edition-finished-notification.ts6
-rw-r--r--server/lib/job-queue/handlers/video-studio-edition.ts (renamed from server/lib/job-queue/handlers/video-edition.ts)38
-rw-r--r--server/lib/job-queue/job-queue.ts10
-rw-r--r--server/lib/notifier/notifier.ts10
-rw-r--r--server/lib/notifier/shared/video-publication/index.ts2
-rw-r--r--server/lib/notifier/shared/video-publication/studio-edition-finished-for-owner.ts (renamed from server/lib/notifier/shared/video-publication/edition-finished-for-owner.ts)8
-rw-r--r--server/lib/server-config-manager.ts4
-rw-r--r--server/lib/user.ts2
-rw-r--r--server/lib/video-state.ts2
-rw-r--r--server/lib/video-studio.ts (renamed from server/lib/video-editor.ts)8
-rw-r--r--server/middlewares/validators/config.ts12
-rw-r--r--server/middlewares/validators/videos/index.ts2
-rw-r--r--server/middlewares/validators/videos/video-studio.ts (renamed from server/middlewares/validators/videos/video-editor.ts)40
-rw-r--r--server/models/user/user-notification-setting.ts8
-rw-r--r--server/tests/api/check-params/config.ts2
-rw-r--r--server/tests/api/check-params/index.ts2
-rw-r--r--server/tests/api/check-params/user-notifications.ts2
-rw-r--r--server/tests/api/check-params/video-studio.ts (renamed from server/tests/api/check-params/video-editor.ts)40
-rw-r--r--server/tests/api/notifications/user-notifications.ts14
-rw-r--r--server/tests/api/server/config.ts6
-rw-r--r--server/tests/api/transcoding/index.ts2
-rw-r--r--server/tests/api/transcoding/video-studio.ts (renamed from server/tests/api/transcoding/video-editor.ts)18
-rw-r--r--server/tests/shared/notifications.ts10
-rw-r--r--shared/models/server/custom-config.model.ts2
-rw-r--r--shared/models/server/job.model.ts29
-rw-r--r--shared/models/server/server-config.model.ts2
-rw-r--r--shared/models/users/user-notification-setting.model.ts2
-rw-r--r--shared/models/users/user-notification.model.ts2
-rw-r--r--shared/models/videos/editor/index.ts1
-rw-r--r--shared/models/videos/editor/video-editor-create-edit.model.ts42
-rw-r--r--shared/models/videos/index.ts2
-rw-r--r--shared/models/videos/studio/index.ts1
-rw-r--r--shared/models/videos/studio/video-studio-create-edit.model.ts42
-rw-r--r--shared/server-commands/server/config-command.ts8
-rw-r--r--shared/server-commands/server/server.ts6
-rw-r--r--shared/server-commands/videos/index.ts2
-rw-r--r--shared/server-commands/videos/video-studio-command.ts (renamed from shared/server-commands/videos/video-editor-command.ts)10
-rw-r--r--support/nginx/peertube2
81 files changed, 368 insertions, 370 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 94f1021bf..eb892bbfd 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -200,7 +200,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
200 resolutions: {} 200 resolutions: {}
201 } 201 }
202 }, 202 },
203 videoEditor: { 203 videoStudio: {
204 enabled: null 204 enabled: null
205 }, 205 },
206 autoBlacklist: { 206 autoBlacklist: {
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
index 52d6c79f6..5c0bea4a5 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
@@ -193,9 +193,9 @@
193 </div> 193 </div>
194 </div> 194 </div>
195 195
196 <div class="form-row mt-2"> <!-- video editor grid --> 196 <div class="form-row mt-2"> <!-- video studio grid -->
197 <div class="form-group col-12 col-lg-4 col-xl-3"> 197 <div class="form-group col-12 col-lg-4 col-xl-3">
198 <div i18n class="inner-form-title">VIDEO EDITOR</div> 198 <div i18n class="inner-form-title">VIDEO STUDIO</div>
199 <div i18n class="inner-form-description"> 199 <div i18n class="inner-form-description">
200 Allows your users to edit their video (cut, add intro/outro, add a watermark etc) 200 Allows your users to edit their video (cut, add intro/outro, add a watermark etc)
201 </div> 201 </div>
@@ -203,14 +203,14 @@
203 203
204 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> 204 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
205 205
206 <ng-container formGroupName="videoEditor"> 206 <ng-container formGroupName="videoStudio">
207 <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> 207 <div class="form-group" [ngClass]="getTranscodingDisabledClass()">
208 <my-peertube-checkbox 208 <my-peertube-checkbox
209 inputName="videoEditorEnabled" formControlName="enabled" 209 inputName="videoStudioEnabled" formControlName="enabled"
210 i18n-labelText labelText="Enable video editor" 210 i18n-labelText labelText="Enable video studio"
211 > 211 >
212 <ng-container ngProjectAs="description" *ngIf="!isTranscodingEnabled()"> 212 <ng-container ngProjectAs="description" *ngIf="!isTranscodingEnabled()">
213 <span i18n>⚠️ You need to enable transcoding first to enable video editor</span> 213 <span i18n>⚠️ You need to enable transcoding first to enable video studio</span>
214 </ng-container> 214 </ng-container>
215 </my-peertube-checkbox> 215 </my-peertube-checkbox>
216 </div> 216 </div>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
index 948c10b69..a38438e3a 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
@@ -72,7 +72,7 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
72 72
73 private checkTranscodingFields () { 73 private checkTranscodingFields () {
74 const transcodingControl = this.form.get('transcoding.enabled') 74 const transcodingControl = this.form.get('transcoding.enabled')
75 const videoEditorControl = this.form.get('videoEditor.enabled') 75 const videoStudioControl = this.form.get('videoStudio.enabled')
76 const hlsControl = this.form.get('transcoding.hls.enabled') 76 const hlsControl = this.form.get('transcoding.hls.enabled')
77 const webtorrentControl = this.form.get('transcoding.webtorrent.enabled') 77 const webtorrentControl = this.form.get('transcoding.webtorrent.enabled')
78 78
@@ -101,7 +101,7 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
101 transcodingControl.valueChanges 101 transcodingControl.valueChanges
102 .subscribe(newValue => { 102 .subscribe(newValue => {
103 if (newValue === false) { 103 if (newValue === false) {
104 videoEditorControl.setValue(false) 104 videoStudioControl.setValue(false)
105 } 105 }
106 }) 106 })
107 } 107 }
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
index 187a3818a..7c13282fa 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
@@ -45,7 +45,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
45 abuseStateChange: $localize`One of your abuse reports has been accepted or rejected by moderators`, 45 abuseStateChange: $localize`One of your abuse reports has been accepted or rejected by moderators`,
46 newPeerTubeVersion: $localize`A new PeerTube version is available`, 46 newPeerTubeVersion: $localize`A new PeerTube version is available`,
47 newPluginVersion: $localize`One of your plugin/theme has a new available version`, 47 newPluginVersion: $localize`One of your plugin/theme has a new available version`,
48 myVideoEditionFinished: $localize`Video edition finished` 48 myVideoStudioEditionFinished: $localize`Video studio edition has finished`
49 } 49 }
50 this.notificationSettingGroups = [ 50 this.notificationSettingGroups = [
51 { 51 {
@@ -64,7 +64,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
64 'blacklistOnMyVideo', 64 'blacklistOnMyVideo',
65 'myVideoPublished', 65 'myVideoPublished',
66 'myVideoImportFinished', 66 'myVideoImportFinished',
67 'myVideoEditionFinished' 67 'myVideoStudioEditionFinished'
68 ] 68 ]
69 }, 69 },
70 70
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts
index 45a586981..a364b9b6a 100644
--- a/client/src/app/+my-library/my-videos/my-videos.component.ts
+++ b/client/src/app/+my-library/my-videos/my-videos.component.ts
@@ -205,9 +205,9 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
205 private buildActions () { 205 private buildActions () {
206 this.videoActions = [ 206 this.videoActions = [
207 { 207 {
208 label: $localize`Editor`, 208 label: $localize`Studio`,
209 linkBuilder: ({ video }) => [ '/video-editor/edit', video.uuid ], 209 linkBuilder: ({ video }) => [ '/studio/edit', video.uuid ],
210 isDisplayed: ({ video }) => video.isEditableBy(this.authService.getUser(), this.serverService.getHTMLConfig().videoEditor.enabled), 210 isDisplayed: ({ video }) => video.isEditableBy(this.authService.getUser(), this.serverService.getHTMLConfig().videoStudio.enabled),
211 iconName: 'film' 211 iconName: 'film'
212 }, 212 },
213 { 213 {
diff --git a/client/src/app/+video-editor/edit/index.ts b/client/src/app/+video-editor/edit/index.ts
deleted file mode 100644
index 390ca80fc..000000000
--- a/client/src/app/+video-editor/edit/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './video-editor-edit.component'
2export * from './video-editor-edit.resolver'
diff --git a/client/src/app/+video-editor/index.ts b/client/src/app/+video-editor/index.ts
deleted file mode 100644
index 5a9e9fdd0..000000000
--- a/client/src/app/+video-editor/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-editor.module'
diff --git a/client/src/app/+video-editor/shared/index.ts b/client/src/app/+video-editor/shared/index.ts
deleted file mode 100644
index eaf88b6f4..000000000
--- a/client/src/app/+video-editor/shared/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-editor.service'
diff --git a/client/src/app/+video-editor/video-editor-routing.module.ts b/client/src/app/+video-editor/video-editor-routing.module.ts
deleted file mode 100644
index 9f37a0dae..000000000
--- a/client/src/app/+video-editor/video-editor-routing.module.ts
+++ /dev/null
@@ -1,30 +0,0 @@
1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router'
3import { VideoEditorEditResolver } from './edit'
4import { VideoEditorEditComponent } from './edit/video-editor-edit.component'
5
6const videoEditorRoutes: Routes = [
7 {
8 path: '',
9 children: [
10 {
11 path: 'edit/:videoId',
12 component: VideoEditorEditComponent,
13 data: {
14 meta: {
15 title: $localize`Edit video`
16 }
17 },
18 resolve: {
19 video: VideoEditorEditResolver
20 }
21 }
22 ]
23 }
24]
25
26@NgModule({
27 imports: [ RouterModule.forChild(videoEditorRoutes) ],
28 exports: [ RouterModule ]
29})
30export class VideoEditorRoutingModule {}
diff --git a/client/src/app/+video-editor/video-editor.module.ts b/client/src/app/+video-editor/video-editor.module.ts
deleted file mode 100644
index 7bbebc17b..000000000
--- a/client/src/app/+video-editor/video-editor.module.ts
+++ /dev/null
@@ -1,27 +0,0 @@
1import { NgModule } from '@angular/core'
2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedMainModule } from '@app/shared/shared-main'
4import { VideoEditorEditComponent, VideoEditorEditResolver } from './edit'
5import { VideoEditorService } from './shared'
6import { VideoEditorRoutingModule } from './video-editor-routing.module'
7
8@NgModule({
9 imports: [
10 VideoEditorRoutingModule,
11
12 SharedMainModule,
13 SharedFormModule
14 ],
15
16 declarations: [
17 VideoEditorEditComponent
18 ],
19
20 exports: [],
21
22 providers: [
23 VideoEditorService,
24 VideoEditorEditResolver
25 ]
26})
27export class VideoEditorModule { }
diff --git a/client/src/app/+video-studio/edit/index.ts b/client/src/app/+video-studio/edit/index.ts
new file mode 100644
index 000000000..ff1d77fc0
--- /dev/null
+++ b/client/src/app/+video-studio/edit/index.ts
@@ -0,0 +1,2 @@
1export * from './video-studio-edit.component'
2export * from './video-studio-edit.resolver'
diff --git a/client/src/app/+video-editor/edit/video-editor-edit.component.html b/client/src/app/+video-studio/edit/video-studio-edit.component.html
index d33dfaf18..a9f34811f 100644
--- a/client/src/app/+video-editor/edit/video-editor-edit.component.html
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.html
@@ -1,5 +1,5 @@
1<div class="margin-content"> 1<div class="margin-content">
2 <h1 class="title-page title-page-single" i18n>Edit {{ video.name }}</h1> 2 <h1 class="title-page title-page-single" i18n>Studio for {{ video.name }}</h1>
3 3
4 <div class="columns"> 4 <div class="columns">
5 <form role="form" [formGroup]="form"> 5 <form role="form" [formGroup]="form">
diff --git a/client/src/app/+video-editor/edit/video-editor-edit.component.scss b/client/src/app/+video-studio/edit/video-studio-edit.component.scss
index 43f336f59..43f336f59 100644
--- a/client/src/app/+video-editor/edit/video-editor-edit.component.scss
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.scss
diff --git a/client/src/app/+video-editor/edit/video-editor-edit.component.ts b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
index 0adf93335..392b65767 100644
--- a/client/src/app/+video-editor/edit/video-editor-edit.component.ts
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
@@ -2,18 +2,18 @@ import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { ConfirmService, Notifier, ServerService } from '@app/core' 3import { ConfirmService, Notifier, ServerService } from '@app/core'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { Video, VideoDetails } from '@app/shared/shared-main' 5import { VideoDetails } from '@app/shared/shared-main'
6import { LoadingBarService } from '@ngx-loading-bar/core' 6import { LoadingBarService } from '@ngx-loading-bar/core'
7import { secondsToTime } from '@shared/core-utils' 7import { secondsToTime } from '@shared/core-utils'
8import { VideoEditorTask, VideoEditorTaskCut } from '@shared/models' 8import { VideoStudioTask, VideoStudioTaskCut } from '@shared/models'
9import { VideoEditorService } from '../shared' 9import { VideoStudioService } from '../shared'
10 10
11@Component({ 11@Component({
12 selector: 'my-video-editor-edit', 12 selector: 'my-video-studio-edit',
13 templateUrl: './video-editor-edit.component.html', 13 templateUrl: './video-studio-edit.component.html',
14 styleUrls: [ './video-editor-edit.component.scss' ] 14 styleUrls: [ './video-studio-edit.component.scss' ]
15}) 15})
16export class VideoEditorEditComponent extends FormReactive implements OnInit { 16export class VideoStudioEditComponent extends FormReactive implements OnInit {
17 isRunningEdition = false 17 isRunningEdition = false
18 18
19 video: VideoDetails 19 video: VideoDetails
@@ -24,7 +24,7 @@ export class VideoEditorEditComponent extends FormReactive implements OnInit {
24 private notifier: Notifier, 24 private notifier: Notifier,
25 private router: Router, 25 private router: Router,
26 private route: ActivatedRoute, 26 private route: ActivatedRoute,
27 private videoEditorService: VideoEditorService, 27 private videoStudioService: VideoStudioService,
28 private loadingBar: LoadingBarService, 28 private loadingBar: LoadingBarService,
29 private confirmService: ConfirmService 29 private confirmService: ConfirmService
30 ) { 30 ) {
@@ -84,11 +84,13 @@ export class VideoEditorEditComponent extends FormReactive implements OnInit {
84 84
85 this.loadingBar.useRef().start() 85 this.loadingBar.useRef().start()
86 86
87 return this.videoEditorService.editVideo(this.video.uuid, tasks) 87 return this.videoStudioService.editVideo(this.video.uuid, tasks)
88 .subscribe({ 88 .subscribe({
89 next: () => { 89 next: () => {
90 this.notifier.success($localize`Video updated.`) 90 this.notifier.success($localize`Edition tasks created.`)
91 this.router.navigateByUrl(Video.buildWatchUrl(this.video)) 91
92 // Don't redirect to old video version watch page that could be confusing for users
93 this.router.navigateByUrl('/my-library/videos')
92 }, 94 },
93 95
94 error: err => { 96 error: err => {
@@ -153,13 +155,13 @@ export class VideoEditorEditComponent extends FormReactive implements OnInit {
153 } 155 }
154 156
155 private buildTasks () { 157 private buildTasks () {
156 const tasks: VideoEditorTask[] = [] 158 const tasks: VideoStudioTask[] = []
157 const value = this.form.value 159 const value = this.form.value
158 160
159 const cut = value['cut'] 161 const cut = value['cut']
160 if (cut['start'] !== 0 || cut['end'] !== this.video.duration) { 162 if (cut['start'] !== 0 || cut['end'] !== this.video.duration) {
161 163
162 const options: VideoEditorTaskCut['options'] = {} 164 const options: VideoStudioTaskCut['options'] = {}
163 if (cut['start'] !== 0) options.start = cut['start'] 165 if (cut['start'] !== 0) options.start = cut['start']
164 if (cut['end'] !== this.video.duration) options.end = cut['end'] 166 if (cut['end'] !== this.video.duration) options.end = cut['end']
165 167
diff --git a/client/src/app/+video-editor/edit/video-editor-edit.resolver.ts b/client/src/app/+video-studio/edit/video-studio-edit.resolver.ts
index 7b95ae834..c658be50b 100644
--- a/client/src/app/+video-editor/edit/video-editor-edit.resolver.ts
+++ b/client/src/app/+video-studio/edit/video-studio-edit.resolver.ts
@@ -4,7 +4,7 @@ import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
4import { VideoService } from '@app/shared/shared-main' 4import { VideoService } from '@app/shared/shared-main'
5 5
6@Injectable() 6@Injectable()
7export class VideoEditorEditResolver implements Resolve<any> { 7export class VideoStudioEditResolver implements Resolve<any> {
8 constructor ( 8 constructor (
9 private videoService: VideoService 9 private videoService: VideoService
10 ) { 10 ) {
diff --git a/client/src/app/+video-studio/index.ts b/client/src/app/+video-studio/index.ts
new file mode 100644
index 000000000..d50c21cdc
--- /dev/null
+++ b/client/src/app/+video-studio/index.ts
@@ -0,0 +1 @@
export * from './video-studio.module'
diff --git a/client/src/app/+video-studio/shared/index.ts b/client/src/app/+video-studio/shared/index.ts
new file mode 100644
index 000000000..9940ac6a9
--- /dev/null
+++ b/client/src/app/+video-studio/shared/index.ts
@@ -0,0 +1 @@
export * from './video-studio.service'
diff --git a/client/src/app/+video-editor/shared/video-editor.service.ts b/client/src/app/+video-studio/shared/video-studio.service.ts
index 5b7053039..8d8b2f0e5 100644
--- a/client/src/app/+video-editor/shared/video-editor.service.ts
+++ b/client/src/app/+video-studio/shared/video-studio.service.ts
@@ -4,19 +4,19 @@ import { Injectable } from '@angular/core'
4import { RestExtractor } from '@app/core' 4import { RestExtractor } from '@app/core'
5import { objectToFormData } from '@app/helpers' 5import { objectToFormData } from '@app/helpers'
6import { VideoService } from '@app/shared/shared-main' 6import { VideoService } from '@app/shared/shared-main'
7import { VideoEditorCreateEdition, VideoEditorTask } from '@shared/models' 7import { VideoStudioCreateEdition, VideoStudioTask } from '@shared/models'
8 8
9@Injectable() 9@Injectable()
10export class VideoEditorService { 10export class VideoStudioService {
11 11
12 constructor ( 12 constructor (
13 private authHttp: HttpClient, 13 private authHttp: HttpClient,
14 private restExtractor: RestExtractor 14 private restExtractor: RestExtractor
15 ) {} 15 ) {}
16 16
17 editVideo (videoId: number | string, tasks: VideoEditorTask[]) { 17 editVideo (videoId: number | string, tasks: VideoStudioTask[]) {
18 const url = VideoService.BASE_VIDEO_URL + '/' + videoId + '/editor/edit' 18 const url = VideoService.BASE_VIDEO_URL + '/' + videoId + '/studio/edit'
19 const body: VideoEditorCreateEdition = { 19 const body: VideoStudioCreateEdition = {
20 tasks 20 tasks
21 } 21 }
22 22
diff --git a/client/src/app/+video-studio/video-studio-routing.module.ts b/client/src/app/+video-studio/video-studio-routing.module.ts
new file mode 100644
index 000000000..bcd9b79a5
--- /dev/null
+++ b/client/src/app/+video-studio/video-studio-routing.module.ts
@@ -0,0 +1,29 @@
1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router'
3import { VideoStudioEditComponent, VideoStudioEditResolver } from './edit'
4
5const videoStudioRoutes: Routes = [
6 {
7 path: '',
8 children: [
9 {
10 path: 'edit/:videoId',
11 component: VideoStudioEditComponent,
12 data: {
13 meta: {
14 title: $localize`Studio`
15 }
16 },
17 resolve: {
18 video: VideoStudioEditResolver
19 }
20 }
21 ]
22 }
23]
24
25@NgModule({
26 imports: [ RouterModule.forChild(videoStudioRoutes) ],
27 exports: [ RouterModule ]
28})
29export class VideoStudioRoutingModule {}
diff --git a/client/src/app/+video-studio/video-studio.module.ts b/client/src/app/+video-studio/video-studio.module.ts
new file mode 100644
index 000000000..1a8763539
--- /dev/null
+++ b/client/src/app/+video-studio/video-studio.module.ts
@@ -0,0 +1,27 @@
1import { NgModule } from '@angular/core'
2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedMainModule } from '@app/shared/shared-main'
4import { VideoStudioEditComponent, VideoStudioEditResolver } from './edit'
5import { VideoStudioService } from './shared'
6import { VideoStudioRoutingModule } from './video-studio-routing.module'
7
8@NgModule({
9 imports: [
10 VideoStudioRoutingModule,
11
12 SharedMainModule,
13 SharedFormModule
14 ],
15
16 declarations: [
17 VideoStudioEditComponent
18 ],
19
20 exports: [],
21
22 providers: [
23 VideoStudioService,
24 VideoStudioEditResolver
25 ]
26})
27export class VideoStudioModule { }
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.ts b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.ts
index 6e8a64f46..af26ea04d 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.ts
@@ -35,7 +35,7 @@ export class ActionButtonsComponent implements OnInit, OnChanges {
35 playlist: false, 35 playlist: false,
36 download: true, 36 download: true,
37 update: true, 37 update: true,
38 editor: true, 38 studio: true,
39 blacklist: true, 39 blacklist: true,
40 delete: true, 40 delete: true,
41 report: true, 41 report: true,
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts
index cd499845b..a831da099 100644
--- a/client/src/app/app-routing.module.ts
+++ b/client/src/app/app-routing.module.ts
@@ -144,8 +144,8 @@ const routes: Routes = [
144 }, 144 },
145 145
146 { 146 {
147 path: 'video-editor', 147 path: 'studio',
148 loadChildren: () => import('./+video-editor/video-editor.module').then(m => m.VideoEditorModule), 148 loadChildren: () => import('./+video-studio/video-studio.module').then(m => m.VideoStudioModule),
149 canActivateChild: [ MetaGuard ] 149 canActivateChild: [ MetaGuard ]
150 }, 150 },
151 151
diff --git a/client/src/app/shared/shared-main/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts
index d1b36f347..a2367166e 100644
--- a/client/src/app/shared/shared-main/users/user-notification.model.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.model.ts
@@ -228,7 +228,7 @@ export class UserNotification implements UserNotificationServer {
228 this.pluginQueryParams.pluginType = this.plugin.type + '' 228 this.pluginQueryParams.pluginType = this.plugin.type + ''
229 break 229 break
230 230
231 case UserNotificationType.MY_VIDEO_EDITION_FINISHED: 231 case UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED:
232 this.videoUrl = this.buildVideoUrl(this.video) 232 this.videoUrl = this.buildVideoUrl(this.video)
233 break 233 break
234 } 234 }
diff --git a/client/src/app/shared/shared-main/users/user-notifications.component.html b/client/src/app/shared/shared-main/users/user-notifications.component.html
index ff1259fb8..e7cdb0183 100644
--- a/client/src/app/shared/shared-main/users/user-notifications.component.html
+++ b/client/src/app/shared/shared-main/users/user-notifications.component.html
@@ -207,7 +207,7 @@
207 </div> 207 </div>
208 </ng-container> 208 </ng-container>
209 209
210 <ng-container *ngSwitchCase="19"> <!-- UserNotificationType.MY_VIDEO_EDITION_FINISHED --> 210 <ng-container *ngSwitchCase="19"> <!-- UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED -->
211 <my-global-icon iconName="film" aria-hidden="true"></my-global-icon> 211 <my-global-icon iconName="film" aria-hidden="true"></my-global-icon>
212 212
213 <div class="message" i18n> 213 <div class="message" i18n>
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts
index 612fcf16c..2d4db9a28 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -228,8 +228,8 @@ export class Video implements VideoServerModel {
228 return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO)) 228 return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO))
229 } 229 }
230 230
231 isEditableBy (user: AuthUser, videoEditorEnabled: boolean) { 231 isEditableBy (user: AuthUser, videoStudioEnabled: boolean) {
232 return videoEditorEnabled && 232 return videoStudioEnabled &&
233 this.state?.id === VideoState.PUBLISHED && 233 this.state?.id === VideoState.PUBLISHED &&
234 this.isUpdatableBy(user) 234 this.isUpdatableBy(user)
235 } 235 }
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index 29a711378..5eef96145 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -29,7 +29,7 @@ export type VideoActionsDisplayType = {
29 liveInfo?: boolean 29 liveInfo?: boolean
30 removeFiles?: boolean 30 removeFiles?: boolean
31 transcoding?: boolean 31 transcoding?: boolean
32 editor?: boolean 32 studio?: boolean
33} 33}
34 34
35@Component({ 35@Component({
@@ -61,7 +61,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
61 liveInfo: false, 61 liveInfo: false,
62 removeFiles: false, 62 removeFiles: false,
63 transcoding: false, 63 transcoding: false,
64 editor: true 64 studio: true
65 } 65 }
66 @Input() placement = 'left' 66 @Input() placement = 'left'
67 67
@@ -153,7 +153,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
153 } 153 }
154 154
155 isVideoEditable () { 155 isVideoEditable () {
156 return this.video.isEditableBy(this.user, this.serverService.getHTMLConfig().videoEditor.enabled) 156 return this.video.isEditableBy(this.user, this.serverService.getHTMLConfig().videoStudio.enabled)
157 } 157 }
158 158
159 isVideoRemovable () { 159 isVideoRemovable () {
@@ -337,10 +337,10 @@ export class VideoActionsDropdownComponent implements OnChanges {
337 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() 337 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable()
338 }, 338 },
339 { 339 {
340 label: $localize`Editor`, 340 label: $localize`Studio`,
341 linkBuilder: ({ video }) => [ '/video-editor/edit', video.uuid ], 341 linkBuilder: ({ video }) => [ '/studio/edit', video.uuid ],
342 iconName: 'film', 342 iconName: 'film',
343 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.editor && this.isVideoEditable() 343 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.studio && this.isVideoEditable()
344 }, 344 },
345 { 345 {
346 label: $localize`Block`, 346 label: $localize`Block`,
diff --git a/config/default.yaml b/config/default.yaml
index 6db8d3803..009c9b6d4 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -436,7 +436,7 @@ live:
436 1440p: false 436 1440p: false
437 2160p: false 437 2160p: false
438 438
439video_editor: 439video_studio:
440 # Enable video edition by users (cut, add intro/outro, add watermark etc) 440 # Enable video edition by users (cut, add intro/outro, add watermark etc)
441 enabled: false 441 enabled: false
442 442
diff --git a/config/production.yaml.example b/config/production.yaml.example
index e6e85da12..8efe07c01 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -444,7 +444,7 @@ live:
444 1440p: false 444 1440p: false
445 2160p: false 445 2160p: false
446 446
447video_editor: 447video_studio:
448 # Enable video edition by users (cut, add intro/outro, add watermark etc) 448 # Enable video edition by users (cut, add intro/outro, add watermark etc)
449 enabled: false 449 enabled: false
450 450
diff --git a/config/test-1.yaml b/config/test-1.yaml
index 0f6d56f1a..fd6a5a341 100644
--- a/config/test-1.yaml
+++ b/config/test-1.yaml
@@ -37,7 +37,7 @@ signup:
37transcoding: 37transcoding:
38 enabled: false 38 enabled: false
39 39
40video_editor: 40video_studio:
41 enabled: false 41 enabled: false
42 42
43live: 43live:
diff --git a/config/test-3.yaml b/config/test-3.yaml
index 3cd3ddba7..c04df6029 100644
--- a/config/test-3.yaml
+++ b/config/test-3.yaml
@@ -31,5 +31,5 @@ admin:
31transcoding: 31transcoding:
32 enabled: false 32 enabled: false
33 33
34video_editor: 34video_studio:
35 enabled: false 35 enabled: false
diff --git a/config/test-4.yaml b/config/test-4.yaml
index 6d8e51945..963dee547 100644
--- a/config/test-4.yaml
+++ b/config/test-4.yaml
@@ -31,5 +31,5 @@ admin:
31transcoding: 31transcoding:
32 enabled: false 32 enabled: false
33 33
34video_editor: 34video_studio:
35 enabled: false 35 enabled: false
diff --git a/config/test-5.yaml b/config/test-5.yaml
index 5f2157fec..f41378c24 100644
--- a/config/test-5.yaml
+++ b/config/test-5.yaml
@@ -31,5 +31,5 @@ admin:
31transcoding: 31transcoding:
32 enabled: false 32 enabled: false
33 33
34video_editor: 34video_studio:
35 enabled: false 35 enabled: false
diff --git a/config/test-6.yaml b/config/test-6.yaml
index 9c43d2b2e..574f89d19 100644
--- a/config/test-6.yaml
+++ b/config/test-6.yaml
@@ -31,5 +31,5 @@ admin:
31transcoding: 31transcoding:
32 enabled: false 32 enabled: false
33 33
34video_editor: 34video_studio:
35 enabled: false 35 enabled: false
diff --git a/config/test.yaml b/config/test.yaml
index 6887523ae..247100fdf 100644
--- a/config/test.yaml
+++ b/config/test.yaml
@@ -168,5 +168,5 @@ views:
168 local_buffer_update_interval: '5 seconds' 168 local_buffer_update_interval: '5 seconds'
169 ip_view_expiration: '1 second' 169 ip_view_expiration: '1 second'
170 170
171video_editor: 171video_studio:
172 enabled: true 172 enabled: true
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'
35import { blacklistRouter } from './blacklist' 35import { blacklistRouter } from './blacklist'
36import { videoCaptionsRouter } from './captions' 36import { videoCaptionsRouter } from './captions'
37import { videoCommentRouter } from './comment' 37import { videoCommentRouter } from './comment'
38import { editorRouter } from './editor' 38import { studioRouter } from './studio'
39import { filesRouter } from './files' 39import { filesRouter } from './files'
40import { videoImportsRouter } from './import' 40import { videoImportsRouter } from './import'
41import { liveRouter } from './live' 41import { liveRouter } from './live'
@@ -52,7 +52,7 @@ const videosRouter = express.Router()
52videosRouter.use('/', blacklistRouter) 52videosRouter.use('/', blacklistRouter)
53videosRouter.use('/', rateVideoRouter) 53videosRouter.use('/', rateVideoRouter)
54videosRouter.use('/', videoCommentRouter) 54videosRouter.use('/', videoCommentRouter)
55videosRouter.use('/', editorRouter) 55videosRouter.use('/', studioRouter)
56videosRouter.use('/', videoCaptionsRouter) 56videosRouter.use('/', videoCaptionsRouter)
57videosRouter.use('/', videoImportsRouter) 57videosRouter.use('/', videoImportsRouter)
58videosRouter.use('/', ownershipVideoRouter) 58videosRouter.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'
2import { createAnyReqFiles } from '@server/helpers/express-utils' 2import { createAnyReqFiles } from '@server/helpers/express-utils'
3import { MIMETYPES } from '@server/initializers/constants' 3import { MIMETYPES } from '@server/initializers/constants'
4import { JobQueue } from '@server/lib/job-queue' 4import { JobQueue } from '@server/lib/job-queue'
5import { buildTaskFileFieldname, getTaskFile } from '@server/lib/video-editor' 5import { buildTaskFileFieldname, getTaskFile } from '@server/lib/video-studio'
6import { 6import {
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'
17import { asyncMiddleware, authenticate, videosEditorAddEditionValidator } from '../../../middlewares' 17import { asyncMiddleware, authenticate, videoStudioAddEditionValidator } from '../../../middlewares'
18 18
19const editorRouter = express.Router() 19const studioRouter = express.Router()
20 20
21const tasksFiles = createAnyReqFiles( 21const 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
46editorRouter.post('/:videoId/editor/edit', 46studioRouter.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
55export { 55export {
56 editorRouter 56 studioRouter
57} 57}
58 58
59// --------------------------------------------------------------------------- 59// ---------------------------------------------------------------------------
60 60
61async function createEditionTasks (req: express.Request, res: express.Response) { 61async 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
79const taskPayloadBuilders: { 79const 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
88function buildTaskPayload (task: VideoEditorTask, indice: number, files: Express.Multer.File[]): VideoEditionTaskPayload { 88function 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
92function buildIntroOutroTask (task: VideoEditorTaskIntro | VideoEditorTaskOutro, indice: number, files: Express.Multer.File[]) { 92function 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
101function buildCutTask (task: VideoEditorTaskCut) { 101function 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
111function buildWatermarkTask (task: VideoEditorTaskWatermark, indice: number, files: Express.Multer.File[]) { 111function 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 @@
1import validator from 'validator' 1import validator from 'validator'
2import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' 2import { CONSTRAINTS_FIELDS } from '@server/initializers/constants'
3import { buildTaskFileFieldname } from '@server/lib/video-editor' 3import { buildTaskFileFieldname } from '@server/lib/video-studio'
4import { VideoEditorTask } from '@shared/models' 4import { VideoStudioTask } from '@shared/models'
5import { isArray } from './misc' 5import { isArray } from './misc'
6import { isVideoFileMimeTypeValid, isVideoImageValid } from './videos' 6import { isVideoFileMimeTypeValid, isVideoImageValid } from './videos'
7 7
8function isValidEditorTasksArray (tasks: any) { 8function 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
15function isEditorCutTaskValid (task: VideoEditorTask) { 15function 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
30function isEditorTaskAddIntroOutroValid (task: VideoEditorTask, indice: number, files: Express.Multer.File[]) { 30function 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
37function isEditorTaskAddWatermarkValid (task: VideoEditorTask, indice: number, files: Express.Multer.File[]) { 37function 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
46export { 46export {
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
263function checkVideoEditorConfig () { 263function 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'
9import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles' 9import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles'
10import { isAbleToUploadVideo } from '@server/lib/user' 10import { isAbleToUploadVideo } from '@server/lib/user'
11import { addOptimizeOrMergeAudioJob } from '@server/lib/video' 11import { addOptimizeOrMergeAudioJob } from '@server/lib/video'
12import { approximateIntroOutroAdditionalSize } from '@server/lib/video-editor'
13import { VideoPathManager } from '@server/lib/video-path-manager' 12import { VideoPathManager } from '@server/lib/video-path-manager'
13import { approximateIntroOutroAdditionalSize } from '@server/lib/video-studio'
14import { UserModel } from '@server/models/user/user' 14import { UserModel } from '@server/models/user/user'
15import { VideoModel } from '@server/models/video/video' 15import { VideoModel } from '@server/models/video/video'
16import { VideoFileModel } from '@server/models/video/video-file' 16import { 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'
28import { 28import {
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'
37import { logger, loggerTagsFactory } from '../../../helpers/logger' 37import { logger, loggerTagsFactory } from '../../../helpers/logger'
38 38
39const lTagsBase = loggerTagsFactory('video-edition') 39const lTagsBase = loggerTagsFactory('video-edition')
40 40
41async function processVideoEdition (job: Job) { 41async 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
108export { 108export {
109 processVideoEdition 109 processVideoStudioEdition
110} 110}
111 111
112// --------------------------------------------------------------------------- 112// ---------------------------------------------------------------------------
113 113
114type TaskProcessorOptions <T extends VideoEditionTaskPayload = VideoEditionTaskPayload> = { 114type 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
122const taskProcessors: { [id in VideoEditorTask['name']]: (options: TaskProcessorOptions) => Promise<any> } = { 122const 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
140function processAddIntroOutro (options: TaskProcessorOptions<VideoEditorTaskIntroPayload | VideoEditorTaskOutroPayload>) { 140function 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
156function processCut (options: TaskProcessorOptions<VideoEditorTaskCutPayload>) { 156function 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
167function processAddWatermark (options: TaskProcessorOptions<VideoEditorTaskWatermarkPayload>) { 167function 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
215async function checkUserQuotaOrThrow (video: MVideoFullLight, payload: VideoEditionPayload) { 215async 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'
25import { logger } from '../../helpers/logger' 25import { logger } from '../../helpers/logger'
@@ -34,10 +34,10 @@ import { processActorKeys } from './handlers/actor-keys'
34import { processEmail } from './handlers/email' 34import { processEmail } from './handlers/email'
35import { processManageVideoTorrent } from './handlers/manage-video-torrent' 35import { processManageVideoTorrent } from './handlers/manage-video-torrent'
36import { processMoveToObjectStorage } from './handlers/move-to-object-storage' 36import { processMoveToObjectStorage } from './handlers/move-to-object-storage'
37import { processVideoEdition } from './handlers/video-edition'
38import { processVideoFileImport } from './handlers/video-file-import' 37import { processVideoFileImport } from './handlers/video-file-import'
39import { processVideoImport } from './handlers/video-import' 38import { processVideoImport } from './handlers/video-import'
40import { processVideoLiveEnding } from './handlers/video-live-ending' 39import { processVideoLiveEnding } from './handlers/video-live-ending'
40import { processVideoStudioEdition } from './handlers/video-studio-edition'
41import { processVideoTranscoding } from './handlers/video-transcoding' 41import { processVideoTranscoding } from './handlers/video-transcoding'
42import { processVideosViewsStats } from './handlers/video-views-stats' 42import { 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
89const jobTypes: JobType[] = [ 89const 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
109class JobQueue { 109class 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 @@
1export * from './new-video-for-subscribers' 1export * from './new-video-for-subscribers'
2export * from './edition-finished-for-owner'
3export * from './import-finished-for-owner' 2export * from './import-finished-for-owner'
4export * from './owned-publication-after-auto-unblacklist' 3export * from './owned-publication-after-auto-unblacklist'
5export * from './owned-publication-after-schedule-update' 4export * from './owned-publication-after-schedule-update'
6export * from './owned-publication-after-transcoding' 5export * from './owned-publication-after-transcoding'
6export * 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
6import { UserNotificationType } from '@shared/models' 6import { UserNotificationType } from '@shared/models'
7import { AbstractNotification } from '../common/abstract-notification' 7import { AbstractNotification } from '../common/abstract-notification'
8 8
9export class EditionFinishedForOwner extends AbstractNotification <MVideoFullLight> { 9export 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 @@
1import { MVideoFullLight } from "@server/types/models" 1import { MVideoFullLight } from '@server/types/models'
2import { getVideoStreamDuration } from "@shared/extra-utils" 2import { getVideoStreamDuration } from '@shared/extra-utils'
3import { VideoEditorTask } from "@shared/models" 3import { VideoStudioTask } from '@shared/models'
4 4
5function buildTaskFileFieldname (indice: number, fieldName = 'file') { 5function 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
13async function approximateIntroOutroAdditionalSize (video: MVideoFullLight, tasks: VideoEditorTask[], fileFinder: (i: number) => string) { 13async 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
166function checkInvalidVideoEditorConfig (customConfig: CustomConfig, res: express.Response) { 166function 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'
2export * from './video-captions' 2export * from './video-captions'
3export * from './video-channels' 3export * from './video-channels'
4export * from './video-comments' 4export * from './video-comments'
5export * from './video-editor'
6export * from './video-files' 5export * from './video-files'
7export * from './video-imports' 6export * from './video-imports'
8export * from './video-live' 7export * from './video-live'
@@ -10,5 +9,6 @@ export * from './video-ownership-changes'
10export * from './video-watch' 9export * from './video-watch'
11export * from './video-rates' 10export * from './video-rates'
12export * from './video-shares' 11export * from './video-shares'
12export * from './video-studio'
13export * from './video-transcoding' 13export * from './video-transcoding'
14export * from './videos' 14export * 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'
2import { body, param } from 'express-validator' 2import { body, param } from 'express-validator'
3import { isIdOrUUIDValid } from '@server/helpers/custom-validators/misc' 3import { isIdOrUUIDValid } from '@server/helpers/custom-validators/misc'
4import { 4import {
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'
10import { cleanUpReqFiles } from '@server/helpers/express-utils' 10import { cleanUpReqFiles } from '@server/helpers/express-utils'
11import { CONFIG } from '@server/initializers/config' 11import { CONFIG } from '@server/initializers/config'
12import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-editor' 12import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-studio'
13import { isAudioFile } from '@shared/extra-utils' 13import { isAudioFile } from '@shared/extra-utils'
14import { HttpStatusCode, UserRight, VideoEditorCreateEdition, VideoEditorTask, VideoState } from '@shared/models' 14import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models'
15import { logger } from '../../../helpers/logger' 15import { logger } from '../../../helpers/logger'
16import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' 16import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared'
17 17
18const videosEditorAddEditionValidator = [ 18const 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
92export { 92export {
93 videosEditorAddEditionValidator 93 videoStudioAddEditionValidator
94} 94}
95 95
96// --------------------------------------------------------------------------- 96// ---------------------------------------------------------------------------
97 97
98const taskCheckers: { 98const 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
107function checkTask (req: express.Request, task: VideoEditorTask, indice?: number) { 107function 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'
25import './video-captions' 25import './video-captions'
26import './video-channels' 26import './video-channels'
27import './video-comments' 27import './video-comments'
28import './video-editor' 28import './video-studio'
29import './video-imports' 29import './video-imports'
30import './video-playlists' 30import './video-playlists'
31import './videos' 31import './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
3import 'mocha' 3import 'mocha'
4import { HttpStatusCode, VideoEditorTask } from '@shared/models' 4import { HttpStatusCode, VideoStudioTask } from '@shared/models'
5import { 5import {
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
14describe('Test video editor API validator', function () { 14describe('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'
17import { wait } from '@shared/core-utils' 17import { wait } from '@shared/core-utils'
18import { buildUUID } from '@shared/extra-utils' 18import { buildUUID } from '@shared/extra-utils'
19import { UserNotification, UserNotificationType, VideoEditorTask, VideoPrivacy } from '@shared/models' 19import { UserNotification, UserNotificationType, VideoStudioTask, VideoPrivacy } from '@shared/models'
20import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' 20import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
21 21
22const expect = chai.expect 22const 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'
2export * from './create-transcoding' 2export * from './create-transcoding'
3export * from './hls' 3export * from './hls'
4export * from './transcoder' 4export * from './transcoder'
5export * from './video-editor' 5export * 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 @@
1import { expect } from 'chai' 1import { expect } from 'chai'
2import { expectStartWith, getAllFiles } from '@server/tests/shared' 2import { expectStartWith, getAllFiles } from '@server/tests/shared'
3import { areObjectStorageTestsDisabled } from '@shared/core-utils' 3import { areObjectStorageTestsDisabled } from '@shared/core-utils'
4import { VideoEditorTask } from '@shared/models' 4import { VideoStudioTask } from '@shared/models'
5import { 5import {
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
17describe('Test video editor', function () { 17describe('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
113async function checkVideoEditionIsFinished (options: CheckerBaseParams & { 113async 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// ---------------------------------------------------------------------------
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 5df606566..ab83ed497 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -147,7 +147,7 @@ export interface CustomConfig {
147 } 147 }
148 } 148 }
149 149
150 videoEditor: { 150 videoStudio: {
151 enabled: boolean 151 enabled: boolean
152 } 152 }
153 153
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index 3b4855eaa..91469d010 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -1,6 +1,6 @@
1import { ContextType } from '../activitypub/context' 1import { ContextType } from '../activitypub/context'
2import { VideoState } from '../videos' 2import { VideoState } from '../videos'
3import { VideoEditorTaskCut } from '../videos/editor' 3import { VideoStudioTaskCut } from '../videos/studio'
4import { VideoResolution } from '../videos/file/video-resolution.enum' 4import { VideoResolution } from '../videos/file/video-resolution.enum'
5import { SendEmailOptions } from './emailer.model' 5import { SendEmailOptions } from './emailer.model'
6 6
@@ -23,7 +23,7 @@ export type JobType =
23 | 'actor-keys' 23 | 'actor-keys'
24 | 'manage-video-torrent' 24 | 'manage-video-torrent'
25 | 'move-to-object-storage' 25 | 'move-to-object-storage'
26 | 'video-edition' 26 | 'video-studio-edition'
27 27
28export interface Job { 28export interface Job {
29 id: number 29 id: number
@@ -117,9 +117,6 @@ export type ManageVideoTorrentPayload =
117interface BaseTranscodingPayload { 117interface BaseTranscodingPayload {
118 videoUUID: string 118 videoUUID: string
119 isNewVideo?: boolean 119 isNewVideo?: boolean
120
121 // Custom notification when the task is finished
122 notification?: 'default' | 'video-edition'
123} 120}
124 121
125export interface HLSTranscodingPayload extends BaseTranscodingPayload { 122export interface HLSTranscodingPayload extends BaseTranscodingPayload {
@@ -178,9 +175,9 @@ export interface MoveObjectStoragePayload {
178 previousVideoState: VideoState 175 previousVideoState: VideoState
179} 176}
180 177
181export type VideoEditorTaskCutPayload = VideoEditorTaskCut 178export type VideoStudioTaskCutPayload = VideoStudioTaskCut
182 179
183export type VideoEditorTaskIntroPayload = { 180export type VideoStudioTaskIntroPayload = {
184 name: 'add-intro' 181 name: 'add-intro'
185 182
186 options: { 183 options: {
@@ -188,7 +185,7 @@ export type VideoEditorTaskIntroPayload = {
188 } 185 }
189} 186}
190 187
191export type VideoEditorTaskOutroPayload = { 188export type VideoStudioTaskOutroPayload = {
192 name: 'add-outro' 189 name: 'add-outro'
193 190
194 options: { 191 options: {
@@ -196,7 +193,7 @@ export type VideoEditorTaskOutroPayload = {
196 } 193 }
197} 194}
198 195
199export type VideoEditorTaskWatermarkPayload = { 196export type VideoStudioTaskWatermarkPayload = {
200 name: 'add-watermark' 197 name: 'add-watermark'
201 198
202 options: { 199 options: {
@@ -204,13 +201,13 @@ export type VideoEditorTaskWatermarkPayload = {
204 } 201 }
205} 202}
206 203
207export type VideoEditionTaskPayload = 204export type VideoStudioTaskPayload =
208 VideoEditorTaskCutPayload | 205 VideoStudioTaskCutPayload |
209 VideoEditorTaskIntroPayload | 206 VideoStudioTaskIntroPayload |
210 VideoEditorTaskOutroPayload | 207 VideoStudioTaskOutroPayload |
211 VideoEditorTaskWatermarkPayload 208 VideoStudioTaskWatermarkPayload
212 209
213export interface VideoEditionPayload { 210export interface VideoStudioEditionPayload {
214 videoUUID: string 211 videoUUID: string
215 tasks: VideoEditionTaskPayload[] 212 tasks: VideoStudioTaskPayload[]
216} 213}
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index 146bed24b..67ad809f7 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -175,7 +175,7 @@ export interface ServerConfig {
175 } 175 }
176 } 176 }
177 177
178 videoEditor: { 178 videoStudio: {
179 enabled: boolean 179 enabled: boolean
180 } 180 }
181 181
diff --git a/shared/models/users/user-notification-setting.model.ts b/shared/models/users/user-notification-setting.model.ts
index 35656f14c..278a05e7a 100644
--- a/shared/models/users/user-notification-setting.model.ts
+++ b/shared/models/users/user-notification-setting.model.ts
@@ -28,5 +28,5 @@ export interface UserNotificationSetting {
28 newPeerTubeVersion: UserNotificationSettingValue 28 newPeerTubeVersion: UserNotificationSettingValue
29 newPluginVersion: UserNotificationSettingValue 29 newPluginVersion: UserNotificationSettingValue
30 30
31 myVideoEditionFinished: UserNotificationSettingValue 31 myVideoStudioEditionFinished: UserNotificationSettingValue
32} 32}
diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts
index a2918194f..0fd7a7181 100644
--- a/shared/models/users/user-notification.model.ts
+++ b/shared/models/users/user-notification.model.ts
@@ -32,7 +32,7 @@ export const enum UserNotificationType {
32 NEW_PLUGIN_VERSION = 17, 32 NEW_PLUGIN_VERSION = 17,
33 NEW_PEERTUBE_VERSION = 18, 33 NEW_PEERTUBE_VERSION = 18,
34 34
35 MY_VIDEO_EDITION_FINISHED = 19 35 MY_VIDEO_STUDIO_EDITION_FINISHED = 19
36} 36}
37 37
38export interface VideoInfo { 38export interface VideoInfo {
diff --git a/shared/models/videos/editor/index.ts b/shared/models/videos/editor/index.ts
deleted file mode 100644
index 3436f2c3f..000000000
--- a/shared/models/videos/editor/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-editor-create-edit.model'
diff --git a/shared/models/videos/editor/video-editor-create-edit.model.ts b/shared/models/videos/editor/video-editor-create-edit.model.ts
deleted file mode 100644
index 36b7c8d55..000000000
--- a/shared/models/videos/editor/video-editor-create-edit.model.ts
+++ /dev/null
@@ -1,42 +0,0 @@
1export interface VideoEditorCreateEdition {
2 tasks: VideoEditorTask[]
3}
4
5export type VideoEditorTask =
6 VideoEditorTaskCut |
7 VideoEditorTaskIntro |
8 VideoEditorTaskOutro |
9 VideoEditorTaskWatermark
10
11export interface VideoEditorTaskCut {
12 name: 'cut'
13
14 options: {
15 start?: number
16 end?: number
17 }
18}
19
20export interface VideoEditorTaskIntro {
21 name: 'add-intro'
22
23 options: {
24 file: Blob | string
25 }
26}
27
28export interface VideoEditorTaskOutro {
29 name: 'add-outro'
30
31 options: {
32 file: Blob | string
33 }
34}
35
36export interface VideoEditorTaskWatermark {
37 name: 'add-watermark'
38
39 options: {
40 file: Blob | string
41 }
42}
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
index e8eb227ab..705e8d0ff 100644
--- a/shared/models/videos/index.ts
+++ b/shared/models/videos/index.ts
@@ -3,7 +3,7 @@ export * from './caption'
3export * from './change-ownership' 3export * from './change-ownership'
4export * from './channel' 4export * from './channel'
5export * from './comment' 5export * from './comment'
6export * from './editor' 6export * from './studio'
7export * from './live' 7export * from './live'
8export * from './file' 8export * from './file'
9export * from './import' 9export * from './import'
diff --git a/shared/models/videos/studio/index.ts b/shared/models/videos/studio/index.ts
new file mode 100644
index 000000000..a1eb98a49
--- /dev/null
+++ b/shared/models/videos/studio/index.ts
@@ -0,0 +1 @@
export * from './video-studio-create-edit.model'
diff --git a/shared/models/videos/studio/video-studio-create-edit.model.ts b/shared/models/videos/studio/video-studio-create-edit.model.ts
new file mode 100644
index 000000000..001d65c90
--- /dev/null
+++ b/shared/models/videos/studio/video-studio-create-edit.model.ts
@@ -0,0 +1,42 @@
1export interface VideoStudioCreateEdition {
2 tasks: VideoStudioTask[]
3}
4
5export type VideoStudioTask =
6 VideoStudioTaskCut |
7 VideoStudioTaskIntro |
8 VideoStudioTaskOutro |
9 VideoStudioTaskWatermark
10
11export interface VideoStudioTaskCut {
12 name: 'cut'
13
14 options: {
15 start?: number
16 end?: number
17 }
18}
19
20export interface VideoStudioTaskIntro {
21 name: 'add-intro'
22
23 options: {
24 file: Blob | string
25 }
26}
27
28export interface VideoStudioTaskOutro {
29 name: 'add-outro'
30
31 options: {
32 file: Blob | string
33 }
34}
35
36export interface VideoStudioTaskWatermark {
37 name: 'add-watermark'
38
39 options: {
40 file: Blob | string
41 }
42}
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index 35a1eec7c..ed4961bc3 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -60,7 +60,7 @@ export class ConfigCommand extends AbstractCommand {
60 transcoding: { 60 transcoding: {
61 enabled: false 61 enabled: false
62 }, 62 },
63 videoEditor: { 63 videoStudio: {
64 enabled: false 64 enabled: false
65 } 65 }
66 } 66 }
@@ -111,10 +111,10 @@ export class ConfigCommand extends AbstractCommand {
111 }) 111 })
112 } 112 }
113 113
114 enableEditor () { 114 enableStudio () {
115 return this.updateExistingSubConfig({ 115 return this.updateExistingSubConfig({
116 newConfig: { 116 newConfig: {
117 videoEditor: { 117 videoStudio: {
118 enabled: true 118 enabled: true
119 } 119 }
120 } 120 }
@@ -339,7 +339,7 @@ export class ConfigCommand extends AbstractCommand {
339 } 339 }
340 } 340 }
341 }, 341 },
342 videoEditor: { 342 videoStudio: {
343 enabled: false 343 enabled: false
344 }, 344 },
345 import: { 345 import: {
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index af4423e8d..2bf31b5a4 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -25,7 +25,7 @@ import {
25 PlaylistsCommand, 25 PlaylistsCommand,
26 ServicesCommand, 26 ServicesCommand,
27 StreamingPlaylistsCommand, 27 StreamingPlaylistsCommand,
28 VideoEditorCommand, 28 VideoStudioCommand,
29 VideosCommand 29 VideosCommand
30} from '../videos' 30} from '../videos'
31import { CommentsCommand } from '../videos/comments-command' 31import { CommentsCommand } from '../videos/comments-command'
@@ -125,7 +125,7 @@ export class PeerTubeServer {
125 login?: LoginCommand 125 login?: LoginCommand
126 users?: UsersCommand 126 users?: UsersCommand
127 objectStorage?: ObjectStorageCommand 127 objectStorage?: ObjectStorageCommand
128 videoEditor?: VideoEditorCommand 128 videoStudio?: VideoStudioCommand
129 videos?: VideosCommand 129 videos?: VideosCommand
130 130
131 constructor (options: { serverNumber: number } | { url: string }) { 131 constructor (options: { serverNumber: number } | { url: string }) {
@@ -396,6 +396,6 @@ export class PeerTubeServer {
396 this.users = new UsersCommand(this) 396 this.users = new UsersCommand(this)
397 this.videos = new VideosCommand(this) 397 this.videos = new VideosCommand(this)
398 this.objectStorage = new ObjectStorageCommand(this) 398 this.objectStorage = new ObjectStorageCommand(this)
399 this.videoEditor = new VideoEditorCommand(this) 399 this.videoStudio = new VideoStudioCommand(this)
400 } 400 }
401} 401}
diff --git a/shared/server-commands/videos/index.ts b/shared/server-commands/videos/index.ts
index 154aed9a6..c9ef6134d 100644
--- a/shared/server-commands/videos/index.ts
+++ b/shared/server-commands/videos/index.ts
@@ -12,5 +12,5 @@ export * from './playlists-command'
12export * from './services-command' 12export * from './services-command'
13export * from './streaming-playlists-command' 13export * from './streaming-playlists-command'
14export * from './comments-command' 14export * from './comments-command'
15export * from './video-editor-command' 15export * from './video-studio-command'
16export * from './videos-command' 16export * from './videos-command'
diff --git a/shared/server-commands/videos/video-editor-command.ts b/shared/server-commands/videos/video-studio-command.ts
index 485edce8e..9fe467cc2 100644
--- a/shared/server-commands/videos/video-editor-command.ts
+++ b/shared/server-commands/videos/video-studio-command.ts
@@ -1,9 +1,9 @@
1import { HttpStatusCode, VideoEditorTask } from '@shared/models' 1import { HttpStatusCode, VideoStudioTask } from '@shared/models'
2import { AbstractCommand, OverrideCommandOptions } from '../shared' 2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3 3
4export class VideoEditorCommand extends AbstractCommand { 4export class VideoStudioCommand extends AbstractCommand {
5 5
6 static getComplexTask (): VideoEditorTask[] { 6 static getComplexTask (): VideoStudioTask[] {
7 return [ 7 return [
8 // Total duration: 2 8 // Total duration: 2
9 { 9 {
@@ -41,9 +41,9 @@ export class VideoEditorCommand extends AbstractCommand {
41 41
42 createEditionTasks (options: OverrideCommandOptions & { 42 createEditionTasks (options: OverrideCommandOptions & {
43 videoId: number | string 43 videoId: number | string
44 tasks: VideoEditorTask[] 44 tasks: VideoStudioTask[]
45 }) { 45 }) {
46 const path = '/api/v1/videos/' + options.videoId + '/editor/edit' 46 const path = '/api/v1/videos/' + options.videoId + '/studio/edit'
47 const attaches: { [id: string]: any } = {} 47 const attaches: { [id: string]: any } = {}
48 48
49 for (let i = 0; i < options.tasks.length; i++) { 49 for (let i = 0; i < options.tasks.length; i++) {
diff --git a/support/nginx/peertube b/support/nginx/peertube
index 425a78900..abb83d5c4 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -85,7 +85,7 @@ server {
85 try_files /dev/null @api; 85 try_files /dev/null @api;
86 } 86 }
87 87
88 location ~ ^/api/v1/videos/(upload|([^/]+/editor/edit))$ { 88 location ~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$ {
89 limit_except POST HEAD { deny all; } 89 limit_except POST HEAD { deny all; }
90 90
91 # This is the maximum upload size, which roughly matches the maximum size of a video file. 91 # This is the maximum upload size, which roughly matches the maximum size of a video file.