aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+search/shared/channel-lazy-load.resolver.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-17 16:02:38 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-06-25 14:44:01 +0200
commit37a44fc915eef2140e22ceb96aba6b6eb2509007 (patch)
treedd4a370ecc96cf38c99b940261aadc27065da7ae /client/src/app/+search/shared/channel-lazy-load.resolver.ts
parent33eb19e5199cc9fa4d73c6675c97508e3e072ef9 (diff)
downloadPeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.gz
PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.zst
PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.zip
Add ability to search playlists
Diffstat (limited to 'client/src/app/+search/shared/channel-lazy-load.resolver.ts')
-rw-r--r--client/src/app/+search/shared/channel-lazy-load.resolver.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/app/+search/shared/channel-lazy-load.resolver.ts b/client/src/app/+search/shared/channel-lazy-load.resolver.ts
new file mode 100644
index 000000000..5e010f795
--- /dev/null
+++ b/client/src/app/+search/shared/channel-lazy-load.resolver.ts
@@ -0,0 +1,24 @@
1import { Injectable } from '@angular/core'
2import { Router } from '@angular/router'
3import { VideoChannel } from '@app/shared/shared-main'
4import { SearchService } from '@app/shared/shared-search'
5import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver'
6
7@Injectable()
8export class ChannelLazyLoadResolver extends AbstractLazyLoadResolver<VideoChannel> {
9
10 constructor (
11 protected router: Router,
12 private searchService: SearchService
13 ) {
14 super()
15 }
16
17 protected finder (url: string) {
18 return this.searchService.searchVideoChannels({ search: url })
19 }
20
21 protected buildUrl (channel: VideoChannel) {
22 return '/video-channels/' + channel.nameWithHost
23 }
24}