Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Don't update live attributes if they did not change

Chocobozzzfd0fdc46961f
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts
index e2331c148e..f27ebd20e5 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -124,11 +124,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
this.video.patch(this.form.value)
- const liveVideoUpdate: LiveVideoUpdate = {
- saveReplay: this.form.value.saveReplay,
- permanentLive: this.form.value.permanentLive
- }
-
this.loadingBar.useRef().start()
this.isUpdatingVideo = true
@@ -141,6 +136,19 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
switchMap(() => {
if (!this.liveVideo) return of(undefined)
+ const liveVideoUpdate: LiveVideoUpdate = {
+ saveReplay: this.form.value.saveReplay,
+ permanentLive: this.form.value.permanentLive
+ }
+
+ console.log(liveVideoUpdate)
+ console.log(this.form.value)
+
+ // Don't update live attributes if they did not change
+ const liveChanged = Object.keys(liveVideoUpdate)
+ .some(key => this.liveVideo[key] !== liveVideoUpdate[key])
+ if (!liveChanged) return of(undefined)
+
return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate)
})
)