aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+accounts/account-video-channels/account-video-channels.component.ts')
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
index e146a5cd2..f6df38857 100644
--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
@@ -1,10 +1,10 @@
1import { from, Subject, Subscription } from 'rxjs' 1import { from, Subject, Subscription } from 'rxjs'
2import { concatMap, map, switchMap, tap } from 'rxjs/operators' 2import { concatMap, map, switchMap, tap } from 'rxjs/operators'
3import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
4import { ComponentPagination, hasMoreItems, MarkdownService, ScreenService, User, UserService } from '@app/core' 4import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core'
5import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' 5import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
6import { NSFWPolicyType, VideoSortField } from '@shared/models'
7import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' 6import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature'
7import { NSFWPolicyType, VideoSortField } from '@shared/models'
8 8
9@Component({ 9@Component({
10 selector: 'my-account-video-channels', 10 selector: 'my-account-video-channels',
@@ -87,7 +87,9 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
87 87
88 this.videoChannelService.listAccountVideoChannels(options) 88 this.videoChannelService.listAccountVideoChannels(options)
89 .pipe( 89 .pipe(
90 tap(res => this.channelPagination.totalItems = res.total), 90 tap(res => {
91 this.channelPagination.totalItems = res.total
92 }),
91 switchMap(res => from(res.data)), 93 switchMap(res => from(res.data)),
92 concatMap(videoChannel => { 94 concatMap(videoChannel => {
93 const options = { 95 const options = {
@@ -113,14 +115,14 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
113 } 115 }
114 116
115 getVideosOf (videoChannel: VideoChannel) { 117 getVideosOf (videoChannel: VideoChannel) {
116 const obj = this.videos[ videoChannel.id ] 118 const obj = this.videos[videoChannel.id]
117 if (!obj) return [] 119 if (!obj) return []
118 120
119 return obj.videos 121 return obj.videos
120 } 122 }
121 123
122 getTotalVideosOf (videoChannel: VideoChannel) { 124 getTotalVideosOf (videoChannel: VideoChannel) {
123 const obj = this.videos[ videoChannel.id ] 125 const obj = this.videos[videoChannel.id]
124 if (!obj) return undefined 126 if (!obj) return undefined
125 127
126 return obj.total 128 return obj.total