diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-19 09:24:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-25 11:24:11 +0200 |
commit | dd24f1bb0a4b252e5342b251ba36853364da7b8e (patch) | |
tree | 41a9506d07413f056fb90425705e258f96fdc77d /client/src/app/+videos/video-list/video-recently-added.component.ts | |
parent | 2e80d256cc75b4b02c8efc3d3e4cdf57ddf401a8 (diff) | |
download | PeerTube-dd24f1bb0a4b252e5342b251ba36853364da7b8e.tar.gz PeerTube-dd24f1bb0a4b252e5342b251ba36853364da7b8e.tar.zst PeerTube-dd24f1bb0a4b252e5342b251ba36853364da7b8e.zip |
Add video filters to common video pages
Diffstat (limited to 'client/src/app/+videos/video-list/video-recently-added.component.ts')
-rw-r--r-- | client/src/app/+videos/video-list/video-recently-added.component.ts | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/client/src/app/+videos/video-list/video-recently-added.component.ts b/client/src/app/+videos/video-list/video-recently-added.component.ts deleted file mode 100644 index 506f92d25..000000000 --- a/client/src/app/+videos/video-list/video-recently-added.component.ts +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | import { Component, ComponentFactoryResolver, OnDestroy, 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 | |||
10 | @Component({ | ||
11 | selector: 'my-videos-recently-added', | ||
12 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], | ||
13 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' | ||
14 | }) | ||
15 | export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { | ||
16 | titlePage: string | ||
17 | sort: VideoSortField = '-publishedAt' | ||
18 | groupByDate = true | ||
19 | |||
20 | loadUserVideoPreferences = true | ||
21 | |||
22 | constructor ( | ||
23 | protected route: ActivatedRoute, | ||
24 | protected serverService: ServerService, | ||
25 | protected router: Router, | ||
26 | protected notifier: Notifier, | ||
27 | protected authService: AuthService, | ||
28 | protected userService: UserService, | ||
29 | protected screenService: ScreenService, | ||
30 | protected storageService: LocalStorageService, | ||
31 | protected cfr: ComponentFactoryResolver, | ||
32 | private videoService: VideoService, | ||
33 | private hooks: HooksService | ||
34 | ) { | ||
35 | super() | ||
36 | |||
37 | this.titlePage = $localize`Recently added` | ||
38 | } | ||
39 | |||
40 | ngOnInit () { | ||
41 | super.ngOnInit() | ||
42 | |||
43 | this.generateSyndicationList() | ||
44 | } | ||
45 | |||
46 | ngOnDestroy () { | ||
47 | super.ngOnDestroy() | ||
48 | } | ||
49 | |||
50 | getVideosObservable (page: number) { | ||
51 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | ||
52 | const params = { | ||
53 | videoPagination: newPagination, | ||
54 | sort: this.sort, | ||
55 | categoryOneOf: this.categoryOneOf, | ||
56 | languageOneOf: this.languageOneOf, | ||
57 | nsfwPolicy: this.nsfwPolicy, | ||
58 | skipCount: true | ||
59 | } | ||
60 | |||
61 | return this.hooks.wrapObsFun( | ||
62 | this.videoService.getVideos.bind(this.videoService), | ||
63 | params, | ||
64 | 'common', | ||
65 | 'filter:api.recently-added-videos.videos.list.params', | ||
66 | 'filter:api.recently-added-videos.videos.list.result' | ||
67 | ) | ||
68 | } | ||
69 | |||
70 | generateSyndicationList () { | ||
71 | this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf) | ||
72 | } | ||
73 | } | ||