import { VideoService } from '../../shared/video/video.service'
import { VideoFilter } from '../../../../../shared/models/videos/video-query.type'
import { I18n } from '@ngx-translate/i18n-polyfill'
+import { ScreenService } from '@app/shared/misc/screen.service'
+import { UserRight } from '../../../../../shared/models/users'
@Component({
selector: 'my-videos-local',
protected authService: AuthService,
protected location: Location,
protected i18n: I18n,
+ protected screenService: ScreenService,
private videoService: VideoService
) {
super()
ngOnInit () {
super.ngOnInit()
+ if (this.authService.isLoggedIn()) {
+ const user = this.authService.getUser()
+ this.displayModerationBlock = user.hasRight(UserRight.SEE_ALL_VIDEOS)
+ }
+
this.generateSyndicationList()
}
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
- return this.videoService.getVideos(newPagination, this.sort, this.filter)
+ return this.videoService.getVideos(newPagination, this.sort, this.filter, this.categoryOneOf)
}
generateSyndicationList () {
- this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter)
+ this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter, this.categoryOneOf)
+ }
+
+ toggleModerationDisplay () {
+ this.filter = this.filter === 'local' ? 'all-local' as 'all-local' : 'local' as 'local'
+
+ this.reloadVideos()
}
}