diff options
Diffstat (limited to 'client/src/app/shared/shared-main/video')
-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) && |