aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video/video.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main/video/video.model.ts')
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts11
1 files changed, 7 insertions, 4 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 2d4db9a28..022bb95ad 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -58,8 +58,7 @@ export class Video implements VideoServerModel {
58 url: string 58 url: string
59 59
60 views: number 60 views: number
61 // If live 61 viewers: number
62 viewers?: number
63 62
64 likes: number 63 likes: number
65 dislikes: number 64 dislikes: number
@@ -234,9 +233,13 @@ export class Video implements VideoServerModel {
234 this.isUpdatableBy(user) 233 this.isUpdatableBy(user)
235 } 234 }
236 235
236 canSeeStats (user: AuthUser) {
237 return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS))
238 }
239
237 canRemoveFiles (user: AuthUser) { 240 canRemoveFiles (user: AuthUser) {
238 return this.isLocal && 241 return this.isLocal &&
239 user.hasRight(UserRight.MANAGE_VIDEO_FILES) && 242 user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
240 this.state.id !== VideoState.TO_TRANSCODE && 243 this.state.id !== VideoState.TO_TRANSCODE &&
241 this.hasHLS() && 244 this.hasHLS() &&
242 this.hasWebTorrent() 245 this.hasWebTorrent()
@@ -244,7 +247,7 @@ export class Video implements VideoServerModel {
244 247
245 canRunTranscoding (user: AuthUser) { 248 canRunTranscoding (user: AuthUser) {
246 return this.isLocal && 249 return this.isLocal &&
247 user.hasRight(UserRight.RUN_VIDEO_TRANSCODING) && 250 user && user.hasRight(UserRight.RUN_VIDEO_TRANSCODING) &&
248 this.state.id !== VideoState.TO_TRANSCODE 251 this.state.id !== VideoState.TO_TRANSCODE
249 } 252 }
250 253