import { Subscription } from 'rxjs'
import { first, tap } from 'rxjs/operators'
import { Subscription } from 'rxjs'
import { first, tap } from 'rxjs/operators'
-import { Component, OnDestroy, OnInit } from '@angular/core'
+import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
import { immutableAssign } from '@app/helpers'
import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
import { AbstractVideoList } from '@app/shared/shared-video-miniature'
import { ActivatedRoute, Router } from '@angular/router'
import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
import { immutableAssign } from '@app/helpers'
import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
import { AbstractVideoList } from '@app/shared/shared-video-miniature'
@Component({
selector: 'my-video-channel-videos',
templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html',
styleUrls: [
@Component({
selector: 'my-video-channel-videos',
templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html',
styleUrls: [
protected router: Router,
protected serverService: ServerService,
protected route: ActivatedRoute,
protected router: Router,
protected serverService: ServerService,
protected route: ActivatedRoute,
protected confirmService: ConfirmService,
protected screenService: ScreenService,
protected storageService: LocalStorageService,
protected confirmService: ConfirmService,
protected screenService: ScreenService,
protected storageService: LocalStorageService,
private videoChannelService: VideoChannelService,
private videoService: VideoService
) {
super()
private videoChannelService: VideoChannelService,
private videoService: VideoService
) {
super()
// Parent get the video channel for us
this.videoChannelSub = this.videoChannelService.videoChannelLoaded
.pipe(first())
// Parent get the video channel for us
this.videoChannelSub = this.videoChannelService.videoChannelLoaded
.pipe(first())
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
+ const options = {
+ videoChannel: this.videoChannel,
+ videoPagination: newPagination,
+ sort: this.sort,
+ nsfwPolicy: this.nsfwPolicy,
+ videoFilter: this.filter
+ }
- this.titlePage = this.i18n(`{total, plural, =1 {Published 1 video} other {Published {{total}} videos}}`, { total })
+ this.titlePage = total === 1
+ ? $localize`Published 1 video`
+ : $localize`Published ${total} videos`
generateSyndicationList () {
this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id)
}
generateSyndicationList () {
this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id)
}