aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+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/+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/+video-channels')
-rw-r--r--client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts20
1 files changed, 19 insertions, 1 deletions
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 e1ec6bbcb..645696f48 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
@@ -6,6 +6,7 @@ import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenServi
6import { immutableAssign } from '@app/helpers' 6import { immutableAssign } from '@app/helpers'
7import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' 7import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
8import { AbstractVideoList } from '@app/shared/shared-video-miniature' 8import { AbstractVideoList } from '@app/shared/shared-video-miniature'
9import { VideoFilter } from '@shared/models'
9 10
10@Component({ 11@Component({
11 selector: 'my-video-channel-videos', 12 selector: 'my-video-channel-videos',
@@ -18,6 +19,8 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On
18 titlePage: string 19 titlePage: string
19 loadOnInit = false 20 loadOnInit = false
20 21
22 filter: VideoFilter = null
23
21 private videoChannel: VideoChannel 24 private videoChannel: VideoChannel
22 private videoChannelSub: Subscription 25 private videoChannelSub: Subscription
23 26
@@ -46,6 +49,8 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On
46 ngOnInit () { 49 ngOnInit () {
47 super.ngOnInit() 50 super.ngOnInit()
48 51
52 this.enableAllFilterIfPossible()
53
49 // Parent get the video channel for us 54 // Parent get the video channel for us
50 this.videoChannelSub = this.videoChannelService.videoChannelLoaded 55 this.videoChannelSub = this.videoChannelService.videoChannelLoaded
51 .pipe(first()) 56 .pipe(first())
@@ -65,9 +70,16 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On
65 70
66 getVideosObservable (page: number) { 71 getVideosObservable (page: number) {
67 const newPagination = immutableAssign(this.pagination, { currentPage: page }) 72 const newPagination = immutableAssign(this.pagination, { currentPage: page })
73 const options = {
74 videoChannel: this.videoChannel,
75 videoPagination: newPagination,
76 sort: this.sort,
77 nsfwPolicy: this.nsfwPolicy,
78 videoFilter: this.filter
79 }
68 80
69 return this.videoService 81 return this.videoService
70 .getVideoChannelVideos(this.videoChannel, newPagination, this.sort, this.nsfwPolicy) 82 .getVideoChannelVideos(options)
71 .pipe( 83 .pipe(
72 tap(({ total }) => { 84 tap(({ total }) => {
73 this.titlePage = total === 1 85 this.titlePage = total === 1
@@ -80,4 +92,10 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On
80 generateSyndicationList () { 92 generateSyndicationList () {
81 this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id) 93 this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id)
82 } 94 }
95
96 toggleModerationDisplay () {
97 this.filter = this.buildLocalFilter(this.filter, null)
98
99 this.reloadVideos()
100 }
83} 101}