diff options
Diffstat (limited to 'client/src/app/shared/video-channel/video-channel.model.ts')
-rw-r--r-- | client/src/app/shared/video-channel/video-channel.model.ts | 9 |
1 files changed, 8 insertions, 1 deletions
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 309b614ae..617d6d44d 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 @@ | |||
1 | import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos' | 1 | import { VideoChannel as ServerVideoChannel, ViewsPerDate } from '../../../../../shared/models/videos' |
2 | import { Actor } from '../actor/actor.model' | 2 | import { Actor } from '../actor/actor.model' |
3 | import { Account } from '../../../../../shared/models/actors' | 3 | import { Account } from '../../../../../shared/models/actors' |
4 | 4 | ||
@@ -8,9 +8,11 @@ export class VideoChannel extends Actor implements ServerVideoChannel { | |||
8 | support: string | 8 | support: string |
9 | isLocal: boolean | 9 | isLocal: boolean |
10 | nameWithHost: string | 10 | nameWithHost: string |
11 | nameWithHostForced: string | ||
11 | ownerAccount?: Account | 12 | ownerAccount?: Account |
12 | ownerBy?: string | 13 | ownerBy?: string |
13 | ownerAvatarUrl?: string | 14 | ownerAvatarUrl?: string |
15 | viewsPerDay?: ViewsPerDate[] | ||
14 | 16 | ||
15 | constructor (hash: ServerVideoChannel) { | 17 | constructor (hash: ServerVideoChannel) { |
16 | super(hash) | 18 | super(hash) |
@@ -20,6 +22,11 @@ export class VideoChannel extends Actor implements ServerVideoChannel { | |||
20 | this.support = hash.support | 22 | this.support = hash.support |
21 | this.isLocal = hash.isLocal | 23 | this.isLocal = hash.isLocal |
22 | this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) | 24 | this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) |
25 | this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) | ||
26 | |||
27 | if (hash.viewsPerDay) { | ||
28 | this.viewsPerDay = hash.viewsPerDay.map(v => ({ ...v, date: new Date(v.date) })) | ||
29 | } | ||
23 | 30 | ||
24 | if (hash.ownerAccount) { | 31 | if (hash.ownerAccount) { |
25 | this.ownerAccount = hash.ownerAccount | 32 | this.ownerAccount = hash.ownerAccount |