diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-30 17:36:26 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-30 17:37:49 +0200 |
commit | 0bf1f2652382089c06434a7d297b638aad778b52 (patch) | |
tree | db507913b7c05c61d6514d16897713010250b7e6 | |
parent | 960a11e89da4e4a6ad6fbad61c71625f89e267b6 (diff) | |
download | PeerTube-0bf1f2652382089c06434a7d297b638aad778b52.tar.gz PeerTube-0bf1f2652382089c06434a7d297b638aad778b52.tar.zst PeerTube-0bf1f2652382089c06434a7d297b638aad778b52.zip |
Add number of videos published by an account/video channel
-rw-r--r-- | client/src/app/+accounts/account-videos/account-videos.component.ts | 5 | ||||
-rw-r--r-- | client/src/app/+video-channels/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' | |||
9 | import { VideoService } from '../../shared/video/video.service' | 9 | import { VideoService } from '../../shared/video/video.service' |
10 | import { Account } from '@app/shared/account/account.model' | 10 | import { Account } from '@app/shared/account/account.model' |
11 | import { AccountService } from '@app/shared/account/account.service' | 11 | import { AccountService } from '@app/shared/account/account.service' |
12 | import { tap } from 'rxjs/operators' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-account-videos', | 15 | selector: 'my-account-videos', |
@@ -60,7 +61,9 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit, | |||
60 | getVideosObservable (page: number) { | 61 | getVideosObservable (page: number) { |
61 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 62 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
62 | 63 | ||
63 | return this.videoService.getAccountVideos(this.account, newPagination, this.sort) | 64 | return this.videoService |
65 | .getAccountVideos(this.account, newPagination, this.sort) | ||
66 | .pipe(tap(({ totalVideos }) => this.titlePage = `Published ${totalVideos} videos`)) | ||
64 | } | 67 | } |
65 | 68 | ||
66 | generateSyndicationList () { | 69 | 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' | |||
9 | import { VideoService } from '../../shared/video/video.service' | 9 | import { VideoService } from '../../shared/video/video.service' |
10 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 10 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
11 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 11 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
12 | import { tap } from 'rxjs/operators' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-video-channel-videos', | 15 | selector: 'my-video-channel-videos', |
@@ -60,7 +61,9 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On | |||
60 | getVideosObservable (page: number) { | 61 | getVideosObservable (page: number) { |
61 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 62 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
62 | 63 | ||
63 | return this.videoService.getVideoChannelVideos(this.videoChannel, newPagination, this.sort) | 64 | return this.videoService |
65 | .getVideoChannelVideos(this.videoChannel, newPagination, this.sort) | ||
66 | .pipe(tap(({ totalVideos }) => this.titlePage = `Published ${totalVideos} videos`)) | ||
64 | } | 67 | } |
65 | 68 | ||
66 | generateSyndicationList () { | 69 | generateSyndicationList () { |