diff options
author | Wicklow <123956049+wickloww@users.noreply.github.com> | 2023-03-31 07:12:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 09:12:21 +0200 |
commit | 05a60d85997c108d39bcfb14f1ffd4c74f8b1e93 (patch) | |
tree | 5041a95ef945620a17f25ba934064b41f6bb00b7 /client/src/app/+videos/+video-edit/shared | |
parent | ebd61437c1ec92bea9772924c7051cb00d71f778 (diff) | |
download | PeerTube-05a60d85997c108d39bcfb14f1ffd4c74f8b1e93.tar.gz PeerTube-05a60d85997c108d39bcfb14f1ffd4c74f8b1e93.tar.zst PeerTube-05a60d85997c108d39bcfb14f1ffd4c74f8b1e93.zip |
Feature/Add replay privacy (#5692)
* Add replay settings feature
* Fix replay settings behaviour
* Fix tests
* Fix tests
* Fix tests
* Update openapi doc and fix tests
* Add tests and fix code
* Models correction
* Add migration and update controller and middleware
* Add check params tests
* Fix video live middleware
* Updated code based on review comments
Diffstat (limited to 'client/src/app/+videos/+video-edit/shared')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.html | 9 | ||||
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.ts | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html index fdd6b2311..b0da84979 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html | |||
@@ -272,7 +272,7 @@ | |||
272 | </div> | 272 | </div> |
273 | </div> | 273 | </div> |
274 | 274 | ||
275 | <div class="form-group" *ngIf="isSaveReplayEnabled()"> | 275 | <div class="form-group" *ngIf="isSaveReplayAllowed()"> |
276 | <my-peertube-checkbox inputName="liveVideoSaveReplay" formControlName="saveReplay"> | 276 | <my-peertube-checkbox inputName="liveVideoSaveReplay" formControlName="saveReplay"> |
277 | <ng-template ptTemplate="label"> | 277 | <ng-template ptTemplate="label"> |
278 | <ng-container i18n>Automatically publish a replay when your live ends</ng-container> | 278 | <ng-container i18n>Automatically publish a replay when your live ends</ng-container> |
@@ -284,6 +284,13 @@ | |||
284 | </my-peertube-checkbox> | 284 | </my-peertube-checkbox> |
285 | </div> | 285 | </div> |
286 | 286 | ||
287 | <div class="form-group mx-4" *ngIf="isSaveReplayEnabled()"> | ||
288 | <label i18n for="replayPrivacy">Privacy of the new replay</label> | ||
289 | <my-select-options | ||
290 | labelForId="replayPrivacy" [items]="videoPrivacies" [clearable]="false" formControlName="replayPrivacy" | ||
291 | ></my-select-options> | ||
292 | </div> | ||
293 | |||
287 | <div class="form-group" *ngIf="isLatencyModeEnabled()"> | 294 | <div class="form-group" *ngIf="isLatencyModeEnabled()"> |
288 | <label i18n for="latencyMode">Latency mode</label> | 295 | <label i18n for="latencyMode">Latency mode</label> |
289 | <my-select-options | 296 | <my-select-options |
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 89687f35e..8ed54ce6b 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 | |||
@@ -165,7 +165,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
165 | liveStreamKey: null, | 165 | liveStreamKey: null, |
166 | permanentLive: null, | 166 | permanentLive: null, |
167 | latencyMode: null, | 167 | latencyMode: null, |
168 | saveReplay: null | 168 | saveReplay: null, |
169 | replayPrivacy: null | ||
169 | } | 170 | } |
170 | 171 | ||
171 | this.formValidatorService.updateFormGroup( | 172 | this.formValidatorService.updateFormGroup( |
@@ -303,10 +304,14 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
303 | modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) | 304 | modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) |
304 | } | 305 | } |
305 | 306 | ||
306 | isSaveReplayEnabled () { | 307 | isSaveReplayAllowed () { |
307 | return this.serverConfig.live.allowReplay | 308 | return this.serverConfig.live.allowReplay |
308 | } | 309 | } |
309 | 310 | ||
311 | isSaveReplayEnabled () { | ||
312 | return this.form.value['saveReplay'] === true | ||
313 | } | ||
314 | |||
310 | isPermanentLiveEnabled () { | 315 | isPermanentLiveEnabled () { |
311 | return this.form.value['permanentLive'] === true | 316 | return this.form.value['permanentLive'] === true |
312 | } | 317 | } |