aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-02 10:49:48 +0200
committerChocobozzz <me@florianbigard.com>2022-05-03 08:32:20 +0200
commit86c5229b4d726202378ef46854383bcafca22310 (patch)
tree871f1fe8b9f3043dcbc132d5771a32f41ab202b1
parent98ebfa39500ce9dfbb782e43c4d269f9a2989698 (diff)
downloadPeerTube-86c5229b4d726202378ef46854383bcafca22310.tar.gz
PeerTube-86c5229b4d726202378ef46854383bcafca22310.tar.zst
PeerTube-86c5229b4d726202378ef46854383bcafca22310.zip
Save replay of permanent live in client
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html3
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts19
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts2
-rw-r--r--server/middlewares/validators/videos/video-live.ts4
-rw-r--r--server/tests/api/check-params/live.ts6
5 files changed, 1 insertions, 33 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
index b29651437..71d5d91f0 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
@@ -30,9 +30,6 @@
30 inputName="liveAllowReplay" formControlName="allowReplay" 30 inputName="liveAllowReplay" formControlName="allowReplay"
31 i18n-labelText labelText="Allow your users to automatically publish a replay of their live" 31 i18n-labelText labelText="Allow your users to automatically publish a replay of their live"
32 > 32 >
33 <ng-container ngProjectAs="description" i18n>
34 If the user quota is reached, PeerTube will automatically terminate the live streaming
35 </ng-container>
36 </my-peertube-checkbox> 33 </my-peertube-checkbox>
37 </div> 34 </div>
38 35
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index a2399eafb..16b964482 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -180,7 +180,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
180 180
181 this.trackChannelChange() 181 this.trackChannelChange()
182 this.trackPrivacyChange() 182 this.trackPrivacyChange()
183 this.trackLivePermanentFieldChange()
184 183
185 this.formBuilt.emit() 184 this.formBuilt.emit()
186 } 185 }
@@ -457,24 +456,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
457 ) 456 )
458 } 457 }
459 458
460 private trackLivePermanentFieldChange () {
461 // We will update the "support" field depending on the channel
462 this.form.controls['permanentLive']
463 .valueChanges
464 .subscribe(
465 permanentLive => {
466 const saveReplayControl = this.form.controls['saveReplay']
467
468 if (permanentLive === true) {
469 saveReplayControl.setValue(false)
470 saveReplayControl.disable()
471 } else {
472 saveReplayControl.enable()
473 }
474 }
475 )
476 }
477
478 private updateSupportField (support: string) { 459 private updateSupportField (support: string) {
479 return this.form.patchValue({ support: support || '' }) 460 return this.form.patchValue({ support: support || '' })
480 } 461 }
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index fde8c884b..725120d16 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -71,7 +71,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
71 nsfw: this.serverConfig.instance.isNSFW, 71 nsfw: this.serverConfig.instance.isNSFW,
72 waitTranscoding: true, 72 waitTranscoding: true,
73 permanentLive: this.firstStepPermanentLive, 73 permanentLive: this.firstStepPermanentLive,
74 saveReplay: this.firstStepPermanentLive === false && this.isReplayAllowed(), 74 saveReplay: this.isReplayAllowed(),
75 channelId: this.firstStepChannelId 75 channelId: this.firstStepChannelId
76 } 76 }
77 77
diff --git a/server/middlewares/validators/videos/video-live.ts b/server/middlewares/validators/videos/video-live.ts
index 8f821c5f9..ff492da0f 100644
--- a/server/middlewares/validators/videos/video-live.ts
+++ b/server/middlewares/validators/videos/video-live.ts
@@ -170,10 +170,6 @@ const videoLiveUpdateValidator = [
170 170
171 const body: LiveVideoUpdate = req.body 171 const body: LiveVideoUpdate = req.body
172 172
173 if (body.permanentLive && body.saveReplay) {
174 return res.fail({ message: 'Cannot set this live as permanent while saving its replay' })
175 }
176
177 if (hasValidSaveReplay(body) !== true) { 173 if (hasValidSaveReplay(body) !== true) {
178 return res.fail({ 174 return res.fail({
179 status: HttpStatusCode.FORBIDDEN_403, 175 status: HttpStatusCode.FORBIDDEN_403,
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 8d520da0d..bbd331657 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -414,12 +414,6 @@ describe('Test video lives API validator', function () {
414 await command.update({ videoId: videoIdNotLive, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) 414 await command.update({ videoId: videoIdNotLive, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
415 }) 415 })
416 416
417 it('Should fail with save replay and permanent live set to true', async function () {
418 const fields = { saveReplay: true, permanentLive: true }
419
420 await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
421 })
422
423 it('Should fail with bad latency setting', async function () { 417 it('Should fail with bad latency setting', async function () {
424 const fields = { latencyMode: 42 } 418 const fields = { latencyMode: 42 }
425 419