import { from, Subject, Subscription } from 'rxjs'
import { concatMap, map, switchMap, tap } from 'rxjs/operators'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { from, Subject, Subscription } from 'rxjs'
import { concatMap, map, switchMap, tap } from 'rxjs/operators'
import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ComponentPagination, hasMoreItems, ScreenService, User, UserService } from '@app/core'
+import { ComponentPagination, hasMoreItems, MarkdownService, User, UserService } from '@app/core'
import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
account: Account
videoChannels: VideoChannel[] = []
export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
account: Account
videoChannels: VideoChannel[] = []
private accountService: AccountService,
private videoChannelService: VideoChannelService,
private videoService: VideoService,
private accountService: AccountService,
private videoChannelService: VideoChannelService,
private videoService: VideoService,
switchMap(res => from(res.data)),
concatMap(videoChannel => {
const options = {
switchMap(res => from(res.data)),
concatMap(videoChannel => {
const options = {
- .subscribe(({ videoChannel, videos }) => {
+ .subscribe(async ({ videoChannel, videos, total }) => {
+ this.channelsDescriptionHTML[videoChannel.id] = await this.markdown.textMarkdownToHTML({
+ markdown: videoChannel.description,
+ withEmoji: true,
+ withHtml: true
+ })
+
- const numberOfVideos = this.screenService.getNumberOfAvailableMiniatures()
+ const obj = this.videos[videoChannel.id]
+ if (!obj) return []
+
+ return obj.videos
+ }
+
+ getTotalVideosOf (videoChannel: VideoChannel) {
+ const obj = this.videos[videoChannel.id]
+ if (!obj) return undefined
+
+ return obj.total
+ }