]>
Commit | Line | Data |
---|---|---|
76d36e0b | 1 | import { Account as AccountInterface } from '../../../../../../shared/models/actors' |
4635f59d | 2 | import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model' |
d3e91a5f | 3 | import { Actor } from '@app/shared/actor/actor.model' |
4635f59d C |
4 | |
5 | export class VideoComment implements VideoCommentServerModel { | |
6 | id: number | |
7 | url: string | |
8 | text: string | |
9 | threadId: number | |
10 | inReplyToCommentId: number | |
11 | videoId: number | |
12 | createdAt: Date | string | |
13 | updatedAt: Date | string | |
76d36e0b | 14 | account: AccountInterface |
4635f59d | 15 | totalReplies: number |
4635f59d | 16 | by: string |
d3e91a5f | 17 | accountAvatarUrl |
4635f59d | 18 | |
4635f59d C |
19 | constructor (hash: VideoCommentServerModel) { |
20 | this.id = hash.id | |
21 | this.url = hash.url | |
22 | this.text = hash.text | |
23 | this.threadId = hash.threadId | |
24 | this.inReplyToCommentId = hash.inReplyToCommentId | |
25 | this.videoId = hash.videoId | |
26 | this.createdAt = new Date(hash.createdAt.toString()) | |
27 | this.updatedAt = new Date(hash.updatedAt.toString()) | |
28 | this.account = hash.account | |
29 | this.totalReplies = hash.totalReplies | |
30 | ||
d3e91a5f C |
31 | this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) |
32 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) | |
4635f59d C |
33 | } |
34 | } |