aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-channel/video-channel.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-16 14:13:01 +0200
committerChocobozzz <me@florianbigard.com>2020-06-16 14:13:01 +0200
commit1ba471c55fdbf05ef2c10152b3e4b0c5d8da3213 (patch)
tree0f231073a848f3089752fda5fe378ff5b64c229b /client/src/app/shared/video-channel/video-channel.model.ts
parentaf75e2d8df92d5d602e11353536ec6804a25f16f (diff)
downloadPeerTube-1ba471c55fdbf05ef2c10152b3e4b0c5d8da3213.tar.gz
PeerTube-1ba471c55fdbf05ef2c10152b3e4b0c5d8da3213.tar.zst
PeerTube-1ba471c55fdbf05ef2c10152b3e4b0c5d8da3213.zip
Add videos count in channels list
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.ts6
1 files changed, 6 insertions, 0 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
index 617d6d44d..2f4597343 100644
--- a/client/src/app/shared/video-channel/video-channel.model.ts
+++ b/client/src/app/shared/video-channel/video-channel.model.ts
@@ -9,9 +9,13 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
9 isLocal: boolean 9 isLocal: boolean
10 nameWithHost: string 10 nameWithHost: string
11 nameWithHostForced: string 11 nameWithHostForced: string
12
12 ownerAccount?: Account 13 ownerAccount?: Account
13 ownerBy?: string 14 ownerBy?: string
14 ownerAvatarUrl?: string 15 ownerAvatarUrl?: string
16
17 videosCount?: number
18
15 viewsPerDay?: ViewsPerDate[] 19 viewsPerDay?: ViewsPerDate[]
16 20
17 constructor (hash: ServerVideoChannel) { 21 constructor (hash: ServerVideoChannel) {
@@ -24,6 +28,8 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
24 this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) 28 this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
25 this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) 29 this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true)
26 30
31 this.videosCount = hash.videosCount
32
27 if (hash.viewsPerDay) { 33 if (hash.viewsPerDay) {
28 this.viewsPerDay = hash.viewsPerDay.map(v => ({ ...v, date: new Date(v.date) })) 34 this.viewsPerDay = hash.viewsPerDay.map(v => ({ ...v, date: new Date(v.date) }))
29 } 35 }