]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add number of videos published by an account/video channel
authorChocobozzz <me@florianbigard.com>
Wed, 30 May 2018 15:36:26 +0000 (17:36 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 30 May 2018 15:37:49 +0000 (17:37 +0200)
client/src/app/+accounts/account-videos/account-videos.component.ts
client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts

index 1b0590f73bf67c917423a9977192a0d7c3be9e2f..eca9fb6b74ae75797571bef7a7f9dff60f9de9c7 100644 (file)
@@ -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 () {
index c3eb359f203d78921ecbc302f30beb96b04503e1..c9e72e512d63bc96a10a2653164801e03496b223 100644 (file)
@@ -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 () {