aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 08:46:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-13 08:46:51 +0200
commita3f45a2ab3cadf0946f06a0539993b828becd516 (patch)
tree6ebd8e6f1fe199e71ac7a6c9e0b6f161dff9fd97 /client/src/app/shared
parentde15b052c59cbd4b99bca835b124485ca1af399e (diff)
downloadPeerTube-a3f45a2ab3cadf0946f06a0539993b828becd516.tar.gz
PeerTube-a3f45a2ab3cadf0946f06a0539993b828becd516.tar.zst
PeerTube-a3f45a2ab3cadf0946f06a0539993b828becd516.zip
Fix default privacy when plugins deleted private
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts12
1 files changed, 12 insertions, 0 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 1c1d06291..49d6fc1c7 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -404,6 +404,18 @@ export class VideoService implements VideosProvider {
404 } 404 }
405 } 405 }
406 406
407 getHighestAvailablePrivacy (serverPrivacies: VideoConstant<VideoPrivacy>[]) {
408 const order = [ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL, VideoPrivacy.UNLISTED, VideoPrivacy.PUBLIC ]
409
410 for (const privacy of order) {
411 if (serverPrivacies.find(p => p.id === privacy)) {
412 return privacy
413 }
414 }
415
416 throw new Error('No highest privacy available')
417 }
418
407 nsfwPolicyToParam (nsfwPolicy: NSFWPolicyType) { 419 nsfwPolicyToParam (nsfwPolicy: NSFWPolicyType) {
408 return nsfwPolicy === 'do_not_list' 420 return nsfwPolicy === 'do_not_list'
409 ? 'false' 421 ? 'false'