From 0bf1f2652382089c06434a7d297b638aad778b52 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Wed, 30 May 2018 17:36:26 +0200
Subject: Add number of videos published by an account/video channel

---
 client/src/app/+accounts/account-videos/account-videos.component.ts  | 5 ++++-
 .../video-channel-videos/video-channel-videos.component.ts           | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts
index 1b0590f73..eca9fb6b7 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.ts
+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts
@@ -9,6 +9,7 @@ import { AbstractVideoList } from '../../shared/video/abstract-video-list'
 import { VideoService } from '../../shared/video/video.service'
 import { Account } from '@app/shared/account/account.model'
 import { AccountService } from '@app/shared/account/account.service'
+import { tap } from 'rxjs/operators'
 
 @Component({
   selector: 'my-account-videos',
@@ -60,7 +61,9 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
   getVideosObservable (page: number) {
     const newPagination = immutableAssign(this.pagination, { currentPage: page })
 
-    return this.videoService.getAccountVideos(this.account, newPagination, this.sort)
+    return this.videoService
+               .getAccountVideos(this.account, newPagination, this.sort)
+               .pipe(tap(({ totalVideos }) => this.titlePage = `Published ${totalVideos} videos`))
   }
 
   generateSyndicationList () {
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
index c3eb359f2..c9e72e512 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
@@ -9,6 +9,7 @@ import { AbstractVideoList } from '../../shared/video/abstract-video-list'
 import { VideoService } from '../../shared/video/video.service'
 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+import { tap } from 'rxjs/operators'
 
 @Component({
   selector: 'my-video-channel-videos',
@@ -60,7 +61,9 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On
   getVideosObservable (page: number) {
     const newPagination = immutableAssign(this.pagination, { currentPage: page })
 
-    return this.videoService.getVideoChannelVideos(this.videoChannel, newPagination, this.sort)
+    return this.videoService
+               .getVideoChannelVideos(this.videoChannel, newPagination, this.sort)
+               .pipe(tap(({ totalVideos }) => this.titlePage = `Published ${totalVideos} videos`))
   }
 
   generateSyndicationList () {
-- 
cgit v1.2.3