]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/video-channel/video-channel.model.ts
Add ability to set a name to a channel
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video-channel / video-channel.model.ts
CommitLineData
e63dbd42 1import { VideoChannel as ServerVideoChannel } from '../../../../../shared/models/videos'
d3e91a5f 2import { Actor } from '../actor/actor.model'
a4f99a76 3import { Account } from '../../../../../shared/models/actors'
d3e91a5f
C
4
5export class VideoChannel extends Actor implements ServerVideoChannel {
6 displayName: string
7 description: string
8 support: string
9 isLocal: boolean
8a19bee1 10 nameWithHost: string
a4f99a76
C
11 ownerAccount?: Account
12 ownerBy?: string
13 ownerAvatarUrl?: string
d3e91a5f
C
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
8a19bee1 22 this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
a4f99a76
C
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 }
d3e91a5f
C
29 }
30}