aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/video-update.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-update.component.ts')
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts5
1 files changed, 3 insertions, 2 deletions
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 412b43967..b70270261 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -9,6 +9,7 @@ import { Video, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit,
9import { LiveVideoService } from '@app/shared/shared-video-live' 9import { LiveVideoService } from '@app/shared/shared-video-live'
10import { LoadingBarService } from '@ngx-loading-bar/core' 10import { LoadingBarService } from '@ngx-loading-bar/core'
11import { logger } from '@root-helpers/logger' 11import { logger } from '@root-helpers/logger'
12import { pick, simpleObjectsDeepEqual } from '@shared/core-utils'
12import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' 13import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
13import { VideoSource } from '@shared/models/videos/video-source' 14import { VideoSource } from '@shared/models/videos/video-source'
14import { hydrateFormFromVideo } from './shared/video-edit-utils' 15import { hydrateFormFromVideo } from './shared/video-edit-utils'
@@ -134,8 +135,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
134 } 135 }
135 136
136 // Don't update live attributes if they did not change 137 // Don't update live attributes if they did not change
137 const liveChanged = Object.keys(liveVideoUpdate) 138 const baseVideo = pick(this.liveVideo, Object.keys(liveVideoUpdate) as (keyof LiveVideoUpdate)[])
138 .some(key => this.liveVideo[key] !== liveVideoUpdate[key]) 139 const liveChanged = !simpleObjectsDeepEqual(baseVideo, liveVideoUpdate)
139 if (!liveChanged) return of(undefined) 140 if (!liveChanged) return of(undefined)
140 141
141 return this.liveVideoService.updateLive(this.videoEdit.id, liveVideoUpdate) 142 return this.liveVideoService.updateLive(this.videoEdit.id, liveVideoUpdate)