1 import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model'
3 export class VideoComment implements VideoCommentServerModel {
8 inReplyToCommentId: number
10 createdAt: Date | string
11 updatedAt: Date | string
20 private static createByString (account: string, serverHost: string) {
21 return account + '@' + serverHost
24 constructor (hash: VideoCommentServerModel) {
28 this.threadId = hash.threadId
29 this.inReplyToCommentId = hash.inReplyToCommentId
30 this.videoId = hash.videoId
31 this.createdAt = new Date(hash.createdAt.toString())
32 this.updatedAt = new Date(hash.updatedAt.toString())
33 this.account = hash.account
34 this.totalReplies = hash.totalReplies
36 this.by = VideoComment.createByString(this.account.name, this.account.host)