Client: Add ability to update video channel avatar
[oweals/peertube.git] / client / src / app / shared / video-channel / video-channel.model.ts
1 import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos/video-channel.model'
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   ownerAccount?: Account
11   ownerBy?: string
12   ownerAvatarUrl?: string
13
14   constructor (hash: ServerVideoChannel) {
15     super(hash)
16
17     this.displayName = hash.displayName
18     this.description = hash.description
19     this.support = hash.support
20     this.isLocal = hash.isLocal
21
22     if (hash.ownerAccount) {
23       this.ownerAccount = hash.ownerAccount
24       this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
25       this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
26     }
27   }
28 }