-import { Component, OnDestroy, OnInit } from '@angular/core'
+import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { immutableAssign } from '@app/helpers'
import { VideoService } from '@app/shared/shared-main'
import { AbstractVideoList } from '@app/shared/shared-video-miniature'
-import { I18n } from '@ngx-translate/i18n-polyfill'
import { UserRight, VideoFilter, VideoSortField } from '@shared/models'
@Component({
useUserVideoPreferences = true
constructor (
- protected i18n: I18n,
protected router: Router,
protected serverService: ServerService,
protected route: ActivatedRoute,
protected userService: UserService,
protected screenService: ScreenService,
protected storageService: LocalStorageService,
+ protected cfr: ComponentFactoryResolver,
private videoService: VideoService,
private hooks: HooksService
) {
super()
- this.titlePage = i18n('Local videos')
+ this.titlePage = $localize`Local videos`
}
ngOnInit () {
super.ngOnInit()
- if (this.authService.isLoggedIn()) {
- const user = this.authService.getUser()
- this.displayModerationBlock = user.hasRight(UserRight.SEE_ALL_VIDEOS)
- }
-
+ this.enableAllFilterIfPossible()
this.generateSyndicationList()
}
}
toggleModerationDisplay () {
- this.filter = this.filter === 'local' ? 'all-local' as 'all-local' : 'local' as 'local'
+ this.filter = this.buildLocalFilter(this.filter, 'local')
this.reloadVideos()
}