]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/video-channel/video-channel.model.ts
309b614aef8cda1bf502eeb49f6ca3bdd3050da7
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video-channel / video-channel.model.ts
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 ownerAccount?: Account
12 ownerBy?: string
13 ownerAvatarUrl?: string
14
15 constructor (hash: ServerVideoChannel) {
16 super(hash)
17
18 this.displayName = hash.displayName
19 this.description = hash.description
20 this.support = hash.support
21 this.isLocal = hash.isLocal
22 this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
23
24 if (hash.ownerAccount) {
25 this.ownerAccount = hash.ownerAccount
26 this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
27 this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
28 }
29 }
30 }