aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts')
-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}