diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 79351ba2a..8e46ce44b 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Account } from '@app/shared/account/account.model' | 1 | import { Account } from '@app/shared/account/account.model' |
2 | import { User } from '../' | 2 | import { User } from '../' |
3 | import { Video as VideoServerModel } from '../../../../../shared' | 3 | import { Video as VideoServerModel } from '../../../../../shared' |
4 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | ||
4 | import { getAbsoluteAPIUrl } from '../misc/utils' | 5 | import { getAbsoluteAPIUrl } from '../misc/utils' |
5 | 6 | ||
6 | export class Video implements VideoServerModel { | 7 | export class Video implements VideoServerModel { |
7 | accountName: string | ||
8 | by: string | 8 | by: string |
9 | createdAt: Date | 9 | createdAt: Date |
10 | updatedAt: Date | 10 | updatedAt: Date |
@@ -32,7 +32,14 @@ export class Video implements VideoServerModel { | |||
32 | likes: number | 32 | likes: number |
33 | dislikes: number | 33 | dislikes: number |
34 | nsfw: boolean | 34 | nsfw: boolean |
35 | account: Account | 35 | |
36 | account: { | ||
37 | name: string | ||
38 | displayName: string | ||
39 | url: string | ||
40 | host: string | ||
41 | avatar: Avatar | ||
42 | } | ||
36 | 43 | ||
37 | private static createDurationString (duration: number) { | 44 | private static createDurationString (duration: number) { |
38 | const minutes = Math.floor(duration / 60) | 45 | const minutes = Math.floor(duration / 60) |
@@ -46,7 +53,6 @@ export class Video implements VideoServerModel { | |||
46 | constructor (hash: VideoServerModel) { | 53 | constructor (hash: VideoServerModel) { |
47 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 54 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
48 | 55 | ||
49 | this.accountName = hash.accountName | ||
50 | this.createdAt = new Date(hash.createdAt.toString()) | 56 | this.createdAt = new Date(hash.createdAt.toString()) |
51 | this.categoryLabel = hash.categoryLabel | 57 | this.categoryLabel = hash.categoryLabel |
52 | this.category = hash.category | 58 | this.category = hash.category |
@@ -61,7 +67,6 @@ export class Video implements VideoServerModel { | |||
61 | this.uuid = hash.uuid | 67 | this.uuid = hash.uuid |
62 | this.isLocal = hash.isLocal | 68 | this.isLocal = hash.isLocal |
63 | this.name = hash.name | 69 | this.name = hash.name |
64 | this.serverHost = hash.serverHost | ||
65 | this.thumbnailPath = hash.thumbnailPath | 70 | this.thumbnailPath = hash.thumbnailPath |
66 | this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath | 71 | this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath |
67 | this.previewPath = hash.previewPath | 72 | this.previewPath = hash.previewPath |
@@ -72,8 +77,9 @@ export class Video implements VideoServerModel { | |||
72 | this.likes = hash.likes | 77 | this.likes = hash.likes |
73 | this.dislikes = hash.dislikes | 78 | this.dislikes = hash.dislikes |
74 | this.nsfw = hash.nsfw | 79 | this.nsfw = hash.nsfw |
80 | this.account = hash.account | ||
75 | 81 | ||
76 | this.by = Account.CREATE_BY_STRING(hash.accountName, hash.serverHost) | 82 | this.by = Account.CREATE_BY_STRING(hash.account.name, hash.account.host) |
77 | } | 83 | } |
78 | 84 | ||
79 | isVideoNSFWForUser (user: User) { | 85 | isVideoNSFWForUser (user: User) { |