diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-03 16:17:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-03 16:17:41 +0200 |
commit | e2409062dedf8856c56ef1bdc98ca623e21c4f3b (patch) | |
tree | c86f7fcbffdaa610bbadb5a4f9abf28d2acd0cdc /client/src/app/search/search.component.ts | |
parent | 8fc02e476869276d35759d19248ddfe7f84ec09c (diff) | |
download | PeerTube-e2409062dedf8856c56ef1bdc98ca623e21c4f3b.tar.gz PeerTube-e2409062dedf8856c56ef1bdc98ca623e21c4f3b.tar.zst PeerTube-e2409062dedf8856c56ef1bdc98ca623e21c4f3b.zip |
Refactor video miniatures
Diffstat (limited to 'client/src/app/search/search.component.ts')
-rw-r--r-- | client/src/app/search/search.component.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index c4a4b1fde..a3383ed8a 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts | |||
@@ -41,10 +41,13 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
41 | private metaService: MetaService, | 41 | private metaService: MetaService, |
42 | private notifier: Notifier, | 42 | private notifier: Notifier, |
43 | private searchService: SearchService, | 43 | private searchService: SearchService, |
44 | private authService: AuthService, | 44 | private authService: AuthService |
45 | private serverService: ServerService | ||
46 | ) { } | 45 | ) { } |
47 | 46 | ||
47 | get user () { | ||
48 | return this.authService.getUser() | ||
49 | } | ||
50 | |||
48 | ngOnInit () { | 51 | ngOnInit () { |
49 | this.subActivatedRoute = this.route.queryParams.subscribe( | 52 | this.subActivatedRoute = this.route.queryParams.subscribe( |
50 | queryParams => { | 53 | queryParams => { |
@@ -76,10 +79,6 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
76 | if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() | 79 | if (this.subActivatedRoute) this.subActivatedRoute.unsubscribe() |
77 | } | 80 | } |
78 | 81 | ||
79 | isVideoBlur (video: Video) { | ||
80 | return video.isVideoNSFWForUser(this.authService.getUser(), this.serverService.getConfig()) | ||
81 | } | ||
82 | |||
83 | isVideoChannel (d: VideoChannel | Video): d is VideoChannel { | 82 | isVideoChannel (d: VideoChannel | Video): d is VideoChannel { |
84 | return d instanceof VideoChannel | 83 | return d instanceof VideoChannel |
85 | } | 84 | } |