X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo-channel%2Fvideo-channel.model.ts;h=ee3288d7a55d5873df3072a008c5596f554f6685;hb=8165d00ac6263cf3c0d61d450960ef36635084ff;hp=fec050cdeccc4b2b691c53c47ddb6ebc18a684aa;hpb=628c155338cf106365a06ca021b9f244b784c003;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/video-channel/video-channel.model.ts b/client/src/app/shared/video-channel/video-channel.model.ts index fec050cde..ee3288d7a 100644 --- a/client/src/app/shared/video-channel/video-channel.model.ts +++ b/client/src/app/shared/video-channel/video-channel.model.ts @@ -1,4 +1,4 @@ -import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos' +import { VideoChannel as ServerVideoChannel, viewsPerTime } from '../../../../../shared/models/videos' import { Actor } from '../actor/actor.model' import { Account } from '../../../../../shared/models/actors' @@ -12,6 +12,7 @@ export class VideoChannel extends Actor implements ServerVideoChannel { ownerAccount?: Account ownerBy?: string ownerAvatarUrl?: string + viewsPerDay?: viewsPerTime[] constructor (hash: ServerVideoChannel) { super(hash) @@ -23,6 +24,10 @@ export class VideoChannel extends Actor implements ServerVideoChannel { this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) + if (hash.viewsPerDay) { + this.viewsPerDay = hash.viewsPerDay.map(v => ({ ...v, date: new Date(v.date)})) + } + if (hash.ownerAccount) { this.ownerAccount = hash.ownerAccount this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)