diff options
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 45366e3e3..b0fa55966 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -332,18 +332,26 @@ export class VideoService implements VideosProvider { | |||
332 | } | 332 | } |
333 | 333 | ||
334 | explainedPrivacyLabels (privacies: VideoConstant<VideoPrivacy>[]) { | 334 | explainedPrivacyLabels (privacies: VideoConstant<VideoPrivacy>[]) { |
335 | const newPrivacies = privacies.slice() | 335 | const base = [ |
336 | 336 | { | |
337 | const privatePrivacy = newPrivacies.find(p => p.id === VideoPrivacy.PRIVATE) | 337 | id: VideoPrivacy.PRIVATE, |
338 | if (privatePrivacy) privatePrivacy.label = this.i18n('Only I can see this video') | 338 | label: this.i18n('Only I can see this video') |
339 | 339 | }, | |
340 | const unlistedPrivacy = newPrivacies.find(p => p.id === VideoPrivacy.UNLISTED) | 340 | { |
341 | if (unlistedPrivacy) unlistedPrivacy.label = this.i18n('Only people with the private link can see this video') | 341 | id: VideoPrivacy.UNLISTED, |
342 | 342 | label: this.i18n('Only people with the private link can see this video') | |
343 | const publicPrivacy = newPrivacies.find(p => p.id === VideoPrivacy.PUBLIC) | 343 | }, |
344 | if (publicPrivacy) publicPrivacy.label = this.i18n('Anyone can see this video') | 344 | { |
345 | id: VideoPrivacy.PUBLIC, | ||
346 | label: this.i18n('Anyone can see this video') | ||
347 | }, | ||
348 | { | ||
349 | id: VideoPrivacy.INTERNAL, | ||
350 | label: this.i18n('Only users of this instance can see this video') | ||
351 | } | ||
352 | ] | ||
345 | 353 | ||
346 | return privacies | 354 | return base.filter(o => !!privacies.find(p => p.id === o.id)) |
347 | } | 355 | } |
348 | 356 | ||
349 | private setVideoRate (id: number, rateType: UserVideoRateType) { | 357 | private setVideoRate (id: number, rateType: UserVideoRateType) { |