aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index ac640c791..1c1d06291 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -378,8 +378,8 @@ export class VideoService implements VideosProvider {
378 ) 378 )
379 } 379 }
380 380
381 explainedPrivacyLabels (privacies: VideoConstant<VideoPrivacy>[], defaultPrivacyId = VideoPrivacy.PUBLIC) { 381 explainedPrivacyLabels (serverPrivacies: VideoConstant<VideoPrivacy>[], defaultPrivacyId = VideoPrivacy.PUBLIC) {
382 const base = [ 382 const descriptions = [
383 { 383 {
384 id: VideoPrivacy.PRIVATE, 384 id: VideoPrivacy.PRIVATE,
385 description: $localize`Only I can see this video` 385 description: $localize`Only I can see this video`
@@ -398,13 +398,9 @@ export class VideoService implements VideosProvider {
398 } 398 }
399 ] 399 ]
400 400
401 const videoPrivacies = base
402 .filter(o => !!privacies.find(p => p.id === o.id)) // filter down to privacies that where in the input
403 .map(o => ({ ...privacies[o.id - 1], ...o })) // merge the input privacies that contain a label, and extend them with a description
404
405 return { 401 return {
406 defaultPrivacyId: videoPrivacies.find(p => p.id === defaultPrivacyId)?.id || videoPrivacies[0].id, 402 defaultPrivacyId: serverPrivacies.find(p => p.id === defaultPrivacyId)?.id || serverPrivacies[0].id,
407 videoPrivacies 403 videoPrivacies: serverPrivacies.map(p => ({ ...p, description: descriptions.find(p => p.id).description }))
408 } 404 }
409 } 405 }
410 406