diff options
Diffstat (limited to 'client/src/app/shared/video/video.model.ts')
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 6929c8755..d86ef8f92 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import { Video as VideoServerModel } from '../../../../../shared' | 1 | import { Video as VideoServerModel } from '../../../../../shared' |
2 | import { User } from '../' | 2 | import { User } from '../' |
3 | import { Account } from '../../../../../shared/models/accounts' | ||
3 | 4 | ||
4 | export class Video implements VideoServerModel { | 5 | export class Video implements VideoServerModel { |
5 | account: string | 6 | accountName: string |
6 | by: string | 7 | by: string |
7 | createdAt: Date | 8 | createdAt: Date |
8 | updatedAt: Date | 9 | updatedAt: Date |
@@ -31,6 +32,7 @@ export class Video implements VideoServerModel { | |||
31 | likes: number | 32 | likes: number |
32 | dislikes: number | 33 | dislikes: number |
33 | nsfw: boolean | 34 | nsfw: boolean |
35 | account: Account | ||
34 | 36 | ||
35 | private static createByString (account: string, serverHost: string) { | 37 | private static createByString (account: string, serverHost: string) { |
36 | return account + '@' + serverHost | 38 | return account + '@' + serverHost |
@@ -52,7 +54,7 @@ export class Video implements VideoServerModel { | |||
52 | absoluteAPIUrl = window.location.origin | 54 | absoluteAPIUrl = window.location.origin |
53 | } | 55 | } |
54 | 56 | ||
55 | this.account = hash.account | 57 | this.accountName = hash.accountName |
56 | this.createdAt = new Date(hash.createdAt.toString()) | 58 | this.createdAt = new Date(hash.createdAt.toString()) |
57 | this.categoryLabel = hash.categoryLabel | 59 | this.categoryLabel = hash.categoryLabel |
58 | this.category = hash.category | 60 | this.category = hash.category |
@@ -80,7 +82,7 @@ export class Video implements VideoServerModel { | |||
80 | this.dislikes = hash.dislikes | 82 | this.dislikes = hash.dislikes |
81 | this.nsfw = hash.nsfw | 83 | this.nsfw = hash.nsfw |
82 | 84 | ||
83 | this.by = Video.createByString(hash.account, hash.serverHost) | 85 | this.by = Video.createByString(hash.accountName, hash.serverHost) |
84 | } | 86 | } |
85 | 87 | ||
86 | isVideoNSFWForUser (user: User) { | 88 | isVideoNSFWForUser (user: User) { |