aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-video-channels
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-18 15:29:38 +0100
committerChocobozzz <me@florianbigard.com>2020-11-18 15:29:38 +0100
commit0aa52e170727ac6bdf441bcaa2353ae0b8a354ed (patch)
tree52fa047cf9970590cab1dcc7a3e5caa8eb004171 /client/src/app/+accounts/account-video-channels
parentff2cac9fa361a3c5489078f441ed54230c045971 (diff)
downloadPeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.gz
PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.zst
PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.zip
Add ability to display all channel/account videos
Diffstat (limited to 'client/src/app/+accounts/account-video-channels')
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.ts18
1 files changed, 15 insertions, 3 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 205245675..f2beb6689 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
@@ -3,7 +3,7 @@ import { concatMap, map, switchMap, tap } from 'rxjs/operators'
3import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
4import { ComponentPagination, hasMoreItems, ScreenService, User, UserService } from '@app/core' 4import { ComponentPagination, hasMoreItems, ScreenService, 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 { VideoSortField } from '@shared/models' 6import { NSFWPolicyType, VideoSortField } from '@shared/models'
7 7
8@Component({ 8@Component({
9 selector: 'my-account-video-channels', 9 selector: 'my-account-video-channels',
@@ -31,6 +31,7 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
31 onChannelDataSubject = new Subject<any>() 31 onChannelDataSubject = new Subject<any>()
32 32
33 userMiniature: User 33 userMiniature: User
34 nsfwPolicy: NSFWPolicyType
34 35
35 private accountSub: Subscription 36 private accountSub: Subscription
36 37
@@ -52,7 +53,11 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
52 }) 53 })
53 54
54 this.userService.getAnonymousOrLoggedUser() 55 this.userService.getAnonymousOrLoggedUser()
55 .subscribe(user => this.userMiniature = user) 56 .subscribe(user => {
57 this.userMiniature = user
58
59 this.nsfwPolicy = user.nsfwPolicy
60 })
56 } 61 }
57 62
58 ngOnDestroy () { 63 ngOnDestroy () {
@@ -65,7 +70,14 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
65 tap(res => this.channelPagination.totalItems = res.total), 70 tap(res => this.channelPagination.totalItems = res.total),
66 switchMap(res => from(res.data)), 71 switchMap(res => from(res.data)),
67 concatMap(videoChannel => { 72 concatMap(videoChannel => {
68 return this.videoService.getVideoChannelVideos(videoChannel, this.videosPagination, this.videosSort) 73 const options = {
74 videoChannel,
75 videoPagination: this.videosPagination,
76 sort: this.videosSort,
77 nsfwPolicy: this.nsfwPolicy
78 }
79
80 return this.videoService.getVideoChannelVideos(options)
69 .pipe(map(data => ({ videoChannel, videos: data.data }))) 81 .pipe(map(data => ({ videoChannel, videos: data.data })))
70 }) 82 })
71 ) 83 )