Add number of videos published by an account/video channel

pull/612/head
Chocobozzz 2018-05-30 17:36:26 +02:00
parent 960a11e89d
commit 0bf1f26523
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 2 deletions

View 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 () {

View 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 () {