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'
5 export class VideoComment implements VideoCommentServerModel {
10 inReplyToCommentId: number
12 createdAt: Date | string
13 updatedAt: Date | string
14 account: AccountInterface
19 constructor (hash: VideoCommentServerModel) {
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
31 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
32 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)