diff options
Diffstat (limited to 'client/src/app/+videos/video-list/trending/video-most-liked.component.ts')
-rw-r--r-- | client/src/app/+videos/video-list/trending/video-most-liked.component.ts | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/client/src/app/+videos/video-list/trending/video-most-liked.component.ts b/client/src/app/+videos/video-list/trending/video-most-liked.component.ts deleted file mode 100644 index 1781cc6aa..000000000 --- a/client/src/app/+videos/video-list/trending/video-most-liked.component.ts +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | import { Component, ComponentFactoryResolver, Injector, OnInit } from '@angular/core' | ||
2 | import { ActivatedRoute, Router } from '@angular/router' | ||
3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' | ||
4 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
5 | import { immutableAssign } from '@app/helpers' | ||
6 | import { VideoService } from '@app/shared/shared-main' | ||
7 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
8 | import { VideoSortField } from '@shared/models' | ||
9 | import { VideoTrendingHeaderComponent } from './video-trending-header.component' | ||
10 | |||
11 | @Component({ | ||
12 | selector: 'my-videos-most-liked', | ||
13 | styleUrls: [ '../../../shared/shared-video-miniature/abstract-video-list.scss' ], | ||
14 | templateUrl: '../../../shared/shared-video-miniature/abstract-video-list.html' | ||
15 | }) | ||
16 | export class VideoMostLikedComponent extends AbstractVideoList implements OnInit { | ||
17 | HeaderComponent = VideoTrendingHeaderComponent | ||
18 | titlePage: string | ||
19 | defaultSort: VideoSortField = '-likes' | ||
20 | |||
21 | useUserVideoPreferences = true | ||
22 | |||
23 | constructor ( | ||
24 | protected router: Router, | ||
25 | protected serverService: ServerService, | ||
26 | protected route: ActivatedRoute, | ||
27 | protected notifier: Notifier, | ||
28 | protected authService: AuthService, | ||
29 | protected userService: UserService, | ||
30 | protected screenService: ScreenService, | ||
31 | protected storageService: LocalStorageService, | ||
32 | protected cfr: ComponentFactoryResolver, | ||
33 | private videoService: VideoService, | ||
34 | private hooks: HooksService | ||
35 | ) { | ||
36 | super() | ||
37 | |||
38 | this.headerComponentInjector = this.getInjector() | ||
39 | } | ||
40 | |||
41 | ngOnInit () { | ||
42 | super.ngOnInit() | ||
43 | |||
44 | this.generateSyndicationList() | ||
45 | } | ||
46 | |||
47 | getVideosObservable (page: number) { | ||
48 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | ||
49 | const params = { | ||
50 | videoPagination: newPagination, | ||
51 | sort: this.sort, | ||
52 | categoryOneOf: this.categoryOneOf, | ||
53 | languageOneOf: this.languageOneOf, | ||
54 | nsfwPolicy: this.nsfwPolicy, | ||
55 | skipCount: true | ||
56 | } | ||
57 | |||
58 | return this.hooks.wrapObsFun( | ||
59 | this.videoService.getVideos.bind(this.videoService), | ||
60 | params, | ||
61 | 'common', | ||
62 | 'filter:api.most-liked-videos.videos.list.params', | ||
63 | 'filter:api.most-liked-videos.videos.list.result' | ||
64 | ) | ||
65 | } | ||
66 | |||
67 | generateSyndicationList () { | ||
68 | this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf) | ||
69 | } | ||
70 | |||
71 | getInjector () { | ||
72 | return Injector.create({ | ||
73 | providers: [{ | ||
74 | provide: 'data', | ||
75 | useValue: { | ||
76 | model: this.defaultSort | ||
77 | } | ||
78 | }] | ||
79 | }) | ||
80 | } | ||
81 | } | ||