]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/video-update.component.ts
Force update live boolean
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-update.component.ts
index e2331c148ea8a072cff803bdb973bfc4e472f0df..654901798b8050641af6c4923d29eaee092ad20b 100644 (file)
@@ -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,16 @@ 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
+            }
+
+            // 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)
           })
         )