aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video-details.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video/video-details.model.ts')
-rw-r--r--client/src/app/shared/video/video-details.model.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts
index 93c380b73..1a956da7c 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/video/video-details.model.ts
@@ -1,3 +1,4 @@
1import { Account } from '../../../../../shared/models/accounts'
1import { Video } from '../../shared/video/video.model' 2import { Video } from '../../shared/video/video.model'
2import { AuthUser } from '../../core' 3import { AuthUser } from '../../core'
3import { 4import {
@@ -10,7 +11,7 @@ import {
10} from '../../../../../shared' 11} from '../../../../../shared'
11 12
12export class VideoDetails extends Video implements VideoDetailsServerModel { 13export class VideoDetails extends Video implements VideoDetailsServerModel {
13 account: string 14 accountName: string
14 by: string 15 by: string
15 createdAt: Date 16 createdAt: Date
16 updatedAt: Date 17 updatedAt: Date
@@ -44,6 +45,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
44 channel: VideoChannel 45 channel: VideoChannel
45 privacy: VideoPrivacy 46 privacy: VideoPrivacy
46 privacyLabel: string 47 privacyLabel: string
48 account: Account
47 49
48 constructor (hash: VideoDetailsServerModel) { 50 constructor (hash: VideoDetailsServerModel) {
49 super(hash) 51 super(hash)
@@ -53,6 +55,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
53 this.descriptionPath = hash.descriptionPath 55 this.descriptionPath = hash.descriptionPath
54 this.files = hash.files 56 this.files = hash.files
55 this.channel = hash.channel 57 this.channel = hash.channel
58 this.account = hash.account
56 } 59 }
57 60
58 getAppropriateMagnetUri (actualDownloadSpeed = 0) { 61 getAppropriateMagnetUri (actualDownloadSpeed = 0) {
@@ -71,7 +74,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
71 } 74 }
72 75
73 isRemovableBy (user: AuthUser) { 76 isRemovableBy (user: AuthUser) {
74 return user && this.isLocal === true && (this.account === user.username || user.hasRight(UserRight.REMOVE_ANY_VIDEO)) 77 return user && this.isLocal === true && (this.accountName === user.username || user.hasRight(UserRight.REMOVE_ANY_VIDEO))
75 } 78 }
76 79
77 isBlackistableBy (user: AuthUser) { 80 isBlackistableBy (user: AuthUser) {
@@ -79,6 +82,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
79 } 82 }
80 83
81 isUpdatableBy (user: AuthUser) { 84 isUpdatableBy (user: AuthUser) {
82 return user && this.isLocal === true && user.username === this.account 85 return user && this.isLocal === true && user.username === this.accountName
83 } 86 }
84} 87}