aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video
diff options
context:
space:
mode:
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) &&