diff options
author | Chocobozzz <me@florianbigard.com> | 2022-04-05 14:03:52 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-04-15 09:49:35 +0200 |
commit | 384ba8b77a8e4805c099f5ea12b41c2ca5776e26 (patch) | |
tree | 6b517033d9265d283677b85e0f57486e0e7fd8cf /client/src/app/shared/shared-main/video/video.model.ts | |
parent | b211106695bb82f6c32e53306081b5262c3d109d (diff) | |
download | PeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.tar.gz PeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.tar.zst PeerTube-384ba8b77a8e4805c099f5ea12b41c2ca5776e26.zip |
Support videos stats in client
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.ts | 11 |
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 | ||