import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService, Notifier, ServerService } from '@app/core'
+import { AuthService, Notifier } from '@app/core'
import { forkJoin, Subscription } from 'rxjs'
import { SearchService } from '@app/search/search.service'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
private metaService: MetaService,
private notifier: Notifier,
private searchService: SearchService,
- private authService: AuthService,
- private serverService: ServerService
+ private authService: AuthService
) { }
+ get user () {
+ return this.authService.getUser()
+ }
+
ngOnInit () {
this.subActivatedRoute = this.route.queryParams.subscribe(
queryParams => {
if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe()
}
- isVideoBlur (video: Video) {
- return video.isVideoNSFWForUser(this.authService.getUser(), this.serverService.getConfig())
- }
-
isVideoChannel (d: VideoChannel | Video): d is VideoChannel {
return d instanceof VideoChannel
}
return this.advancedSearch.size()
}
+ removeVideoFromArray (video: Video) {
+ this.results = this.results.filter(r => !this.isVideo(r) || r.id !== video.id)
+ }
+
private resetPagination () {
this.pagination.currentPage = 1
this.pagination.totalItems = null