]>
Commit | Line | Data |
---|---|---|
1 | import { Account as AccountInterface } from '../../../../../../shared/models/actors' | |
2 | import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model' | |
3 | import { Actor } from '@app/shared/actor/actor.model' | |
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 | |
14 | account: AccountInterface | |
15 | totalReplies: number | |
16 | by: string | |
17 | accountAvatarUrl | |
18 | ||
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 | ||
31 | this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) | |
32 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) | |
33 | } | |
34 | } |