1 import { Account } from '../../../../../../shared/models/actors'
2 import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model'
4 export class VideoComment implements VideoCommentServerModel {
9 inReplyToCommentId: number
11 createdAt: Date | string
12 updatedAt: Date | string
18 private static createByString (account: string, serverHost: string) {
19 return account + '@' + serverHost
22 constructor (hash: VideoCommentServerModel) {
26 this.threadId = hash.threadId
27 this.inReplyToCommentId = hash.inReplyToCommentId
28 this.videoId = hash.videoId
29 this.createdAt = new Date(hash.createdAt.toString())
30 this.updatedAt = new Date(hash.updatedAt.toString())
31 this.account = hash.account
32 this.totalReplies = hash.totalReplies
34 this.by = VideoComment.createByString(this.account.name, this.account.host)