From 37a44fc915eef2140e22ceb96aba6b6eb2509007 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jun 2021 16:02:38 +0200 Subject: Add ability to search playlists --- .../+search/shared/channel-lazy-load.resolver.ts | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 client/src/app/+search/shared/channel-lazy-load.resolver.ts (limited to 'client/src/app/+search/shared/channel-lazy-load.resolver.ts') 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 @@ +import { Injectable } from '@angular/core' +import { Router } from '@angular/router' +import { VideoChannel } from '@app/shared/shared-main' +import { SearchService } from '@app/shared/shared-search' +import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver' + +@Injectable() +export class ChannelLazyLoadResolver extends AbstractLazyLoadResolver { + + constructor ( + protected router: Router, + private searchService: SearchService + ) { + super() + } + + protected finder (url: string) { + return this.searchService.searchVideoChannels({ search: url }) + } + + protected buildUrl (channel: VideoChannel) { + return '/video-channels/' + channel.nameWithHost + } +} -- cgit v1.2.3