aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-channel/video-channel.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-23 14:10:17 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-23 16:00:49 +0200
commit67ed6552b831df66713bac9e672738796128d33f (patch)
tree59c97d41e0b49d75a90aa3de987968ab9b1ff447 /client/src/app/shared/video-channel/video-channel.model.ts
parent0c4bacbff53bc732f5a2677d62a6ead7752e2405 (diff)
downloadPeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.gz
PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.zst
PeerTube-67ed6552b831df66713bac9e672738796128d33f.zip
Reorganize client shared modules
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.ts43
1 files changed, 0 insertions, 43 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
deleted file mode 100644
index 2f4597343..000000000
--- a/client/src/app/shared/video-channel/video-channel.model.ts
+++ /dev/null
@@ -1,43 +0,0 @@
1import { VideoChannel as ServerVideoChannel, ViewsPerDate } from '../../../../../shared/models/videos'
2import { Actor } from '../actor/actor.model'
3import { Account } from '../../../../../shared/models/actors'
4
5export 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
13 ownerAccount?: Account
14 ownerBy?: string
15 ownerAvatarUrl?: string
16
17 videosCount?: number
18
19 viewsPerDay?: ViewsPerDate[]
20
21 constructor (hash: ServerVideoChannel) {
22 super(hash)
23
24 this.displayName = hash.displayName
25 this.description = hash.description
26 this.support = hash.support
27 this.isLocal = hash.isLocal
28 this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
29 this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true)
30
31 this.videosCount = hash.videosCount
32
33 if (hash.viewsPerDay) {
34 this.viewsPerDay = hash.viewsPerDay.map(v => ({ ...v, date: new Date(v.date) }))
35 }
36
37 if (hash.ownerAccount) {
38 this.ownerAccount = hash.ownerAccount
39 this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
40 this.ownerAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.ownerAccount)
41 }
42 }
43}