]>
Commit | Line | Data |
---|---|---|
1 | import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos' | |
2 | import { Actor } from '../actor/actor.model' | |
3 | import { Account } from '../../../../../shared/models/actors' | |
4 | ||
5 | export class VideoChannel extends Actor implements ServerVideoChannel { | |
6 | displayName: string | |
7 | description: string | |
8 | support: string | |
9 | isLocal: boolean | |
10 | nameWithHost: string | |
11 | nameWithHostForced: string | |
12 | ownerAccount?: Account | |
13 | ownerBy?: string | |
14 | ownerAvatarUrl?: string | |
15 | ||
16 | constructor (hash: ServerVideoChannel) { | |
17 | super(hash) | |
18 | ||
19 | this.displayName = hash.displayName | |
20 | this.description = hash.description | |
21 | this.support = hash.support | |
22 | this.isLocal = hash.isLocal | |
23 | this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) | |
24 | this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) | |
25 | ||
26 | if (hash.ownerAccount) { | |
27 | this.ownerAccount = hash.ownerAccount | |
28 | this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host) | |
29 | this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount) | |
30 | } | |
31 | } | |
32 | } |