aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-13 12:00:13 +0200
committerChocobozzz <me@florianbigard.com>2022-09-13 12:00:13 +0200
commit367a9dc69975a0db01962dbb7106635fb8eb1696 (patch)
treeedcae09eb37dc50012c66c229a7e0d3fa23a2084 /client/src/app/shared/shared-main/video
parent9f244885f0974730c488233827b63ff0ff08319e (diff)
downloadPeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.gz
PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.tar.zst
PeerTube-367a9dc69975a0db01962dbb7106635fb8eb1696.zip
Don't display remove file icon in some cases
Diffstat (limited to 'client/src/app/shared/shared-main/video')
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts
index 2e4ab87d7..c9c6b979c 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -1,8 +1,8 @@
1import { AuthUser } from '@app/core' 1import { AuthUser } from '@app/core'
2import { User } from '@app/core/users/user.model' 2import { User } from '@app/core/users/user.model'
3import { durationToString, prepareIcu, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers' 3import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl, prepareIcu } from '@app/helpers'
4import { Actor } from '@app/shared/shared-main/account/actor.model' 4import { Actor } from '@app/shared/shared-main/account/actor.model'
5import { buildVideoWatchPath } from '@shared/core-utils' 5import { buildVideoWatchPath, getAllFiles } from '@shared/core-utils'
6import { peertubeTranslate } from '@shared/core-utils/i18n' 6import { peertubeTranslate } from '@shared/core-utils/i18n'
7import { 7import {
8 ActorImage, 8 ActorImage,
@@ -240,6 +240,13 @@ export class Video implements VideoServerModel {
240 return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS)) 240 return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS))
241 } 241 }
242 242
243 canRemoveOneFile (user: AuthUser) {
244 return this.isLocal &&
245 user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
246 this.state.id !== VideoState.TO_TRANSCODE &&
247 getAllFiles(this).length > 1
248 }
249
243 canRemoveFiles (user: AuthUser) { 250 canRemoveFiles (user: AuthUser) {
244 return this.isLocal && 251 return this.isLocal &&
245 user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) && 252 user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&