diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-14 09:57:37 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-04-14 10:14:40 +0200 |
commit | e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1 (patch) | |
tree | 88dcb15bd523af9fe42fa1fc1d380c3b8dfba089 /client/src | |
parent | 8b95440c8ac050594955926f18dab9f6d4a86e19 (diff) | |
download | PeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.tar.gz PeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.tar.zst PeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.zip |
Allow to update a live with untouched privacy
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-update.component.ts | 5 |
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, | |||
9 | import { LiveVideoService } from '@app/shared/shared-video-live' | 9 | import { LiveVideoService } from '@app/shared/shared-video-live' |
10 | import { LoadingBarService } from '@ngx-loading-bar/core' | 10 | import { LoadingBarService } from '@ngx-loading-bar/core' |
11 | import { logger } from '@root-helpers/logger' | 11 | import { logger } from '@root-helpers/logger' |
12 | import { pick, simpleObjectsDeepEqual } from '@shared/core-utils' | ||
12 | import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' | 13 | import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' |
13 | import { VideoSource } from '@shared/models/videos/video-source' | 14 | import { VideoSource } from '@shared/models/videos/video-source' |
14 | import { hydrateFormFromVideo } from './shared/video-edit-utils' | 15 | import { 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) |