]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+search/shared/video-lazy-load.resolver.ts
Add ability to search playlists
[github/Chocobozzz/PeerTube.git] / client / src / app / +search / shared / video-lazy-load.resolver.ts
1 import { Injectable } from '@angular/core'
2 import { Router } from '@angular/router'
3 import { Video } from '@app/shared/shared-main'
4 import { SearchService } from '@app/shared/shared-search'
5 import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver'
6
7 @Injectable()
8 export class VideoLazyLoadResolver extends AbstractLazyLoadResolver<Video> {
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.searchVideos({ search: url })
19 }
20
21 protected buildUrl (video: Video) {
22 return '/w/' + video.uuid
23 }
24 }