aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+search/shared/video-lazy-load.resolver.ts
blob: 12b5b2e82539fbed6127c55c81090ab162bd845d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Injectable } from '@angular/core'
import { Router } from '@angular/router'
import { Video } from '@app/shared/shared-main'
import { SearchService } from '@app/shared/shared-search'
import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver'

@Injectable()
export class VideoLazyLoadResolver extends AbstractLazyLoadResolver<Video> {

  constructor (
    protected router: Router,
    private searchService: SearchService
  ) {
    super()
  }

  protected finder (url: string) {
    return this.searchService.searchVideos({ search: url })
  }

  protected buildUrl (video: Video) {
    return '/w/' + video.uuid
  }
}