aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts')
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
index 87caec8a5..a91debbef 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
@@ -1,8 +1,9 @@
1import { map, switchMap } from 'rxjs/operators' 1import { map, switchMap } from 'rxjs/operators'
2import { Component, Input, OnInit } from '@angular/core' 2import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
3import { MarkdownService, UserService } from '@app/core' 3import { MarkdownService, UserService } from '@app/core'
4import { Video, VideoSortField } from '@shared/models/videos' 4import { Video, VideoSortField } from '@shared/models/videos'
5import { VideoChannel, VideoChannelService, VideoService } from '../../shared-main' 5import { VideoChannel, VideoChannelService, VideoService } from '../../shared-main'
6import { CustomMarkupComponent } from './shared'
6 7
7/* 8/*
8 * Markup component that creates a channel miniature only 9 * Markup component that creates a channel miniature only
@@ -13,11 +14,13 @@ import { VideoChannel, VideoChannelService, VideoService } from '../../shared-ma
13 templateUrl: 'channel-miniature-markup.component.html', 14 templateUrl: 'channel-miniature-markup.component.html',
14 styleUrls: [ 'channel-miniature-markup.component.scss' ] 15 styleUrls: [ 'channel-miniature-markup.component.scss' ]
15}) 16})
16export class ChannelMiniatureMarkupComponent implements OnInit { 17export class ChannelMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
17 @Input() name: string 18 @Input() name: string
18 @Input() displayLatestVideo: boolean 19 @Input() displayLatestVideo: boolean
19 @Input() displayDescription: boolean 20 @Input() displayDescription: boolean
20 21
22 @Output() loaded = new EventEmitter<boolean>()
23
21 channel: VideoChannel 24 channel: VideoChannel
22 descriptionHTML: string 25 descriptionHTML: string
23 totalVideos: number 26 totalVideos: number
@@ -61,9 +64,13 @@ export class ChannelMiniatureMarkupComponent implements OnInit {
61 map(user => user.nsfwPolicy), 64 map(user => user.nsfwPolicy),
62 switchMap(nsfwPolicy => this.videoService.getVideoChannelVideos({ ...videoOptions, nsfwPolicy })) 65 switchMap(nsfwPolicy => this.videoService.getVideoChannelVideos({ ...videoOptions, nsfwPolicy }))
63 ) 66 )
64 .subscribe(({ total, data }) => { 67 .subscribe({
65 this.totalVideos = total 68 next: ({ total, data }) => {
66 this.video = data[0] 69 this.totalVideos = total
70 this.video = data[0]
71 },
72
73 complete: () => this.loaded.emit(true)
67 }) 74 })
68 } 75 }
69} 76}