diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-13 12:00:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-13 12:00:13 +0200 |
commit | 367a9dc69975a0db01962dbb7106635fb8eb1696 (patch) | |
tree | edcae09eb37dc50012c66c229a7e0d3fa23a2084 /client/src/app/shared/shared-main | |
parent | 9f244885f0974730c488233827b63ff0ff08319e (diff) | |
download | PeerTube-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')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.model.ts | 11 |
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 @@ | |||
1 | import { AuthUser } from '@app/core' | 1 | import { AuthUser } from '@app/core' |
2 | import { User } from '@app/core/users/user.model' | 2 | import { User } from '@app/core/users/user.model' |
3 | import { durationToString, prepareIcu, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers' | 3 | import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl, prepareIcu } from '@app/helpers' |
4 | import { Actor } from '@app/shared/shared-main/account/actor.model' | 4 | import { Actor } from '@app/shared/shared-main/account/actor.model' |
5 | import { buildVideoWatchPath } from '@shared/core-utils' | 5 | import { buildVideoWatchPath, getAllFiles } from '@shared/core-utils' |
6 | import { peertubeTranslate } from '@shared/core-utils/i18n' | 6 | import { peertubeTranslate } from '@shared/core-utils/i18n' |
7 | import { | 7 | import { |
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) && |