aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-recently-added.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-23 14:49:20 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-23 16:00:49 +0200
commit1942f11d5ee6926ad93dc1b79fae18325ba5de18 (patch)
tree3f2a3cd9466a56c419d197ac832a3e9cbc86bec4 /client/src/app/videos/video-list/video-recently-added.component.ts
parent67ed6552b831df66713bac9e672738796128d33f (diff)
downloadPeerTube-1942f11d5ee6926ad93dc1b79fae18325ba5de18.tar.gz
PeerTube-1942f11d5ee6926ad93dc1b79fae18325ba5de18.tar.zst
PeerTube-1942f11d5ee6926ad93dc1b79fae18325ba5de18.zip
Lazy load all routes
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.ts74
1 files changed, 0 insertions, 74 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 c9395133f..000000000
--- a/client/src/app/videos/video-list/video-recently-added.component.ts
+++ /dev/null
@@ -1,74 +0,0 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { HooksService } from '@app/core/plugins/hooks.service'
5import { immutableAssign } from '@app/helpers'
6import { VideoService } from '@app/shared/shared-main'
7import { AbstractVideoList } from '@app/shared/shared-video-miniature'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoSortField } from '@shared/models'
10
11@Component({
12 selector: 'my-videos-recently-added',
13 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
14 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
15})
16export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy {
17 titlePage: string
18 sort: VideoSortField = '-publishedAt'
19 groupByDate = true
20
21 useUserVideoPreferences = true
22
23 constructor (
24 protected i18n: I18n,
25 protected route: ActivatedRoute,
26 protected serverService: ServerService,
27 protected router: Router,
28 protected notifier: Notifier,
29 protected authService: AuthService,
30 protected userService: UserService,
31 protected screenService: ScreenService,
32 protected storageService: LocalStorageService,
33 private videoService: VideoService,
34 private hooks: HooksService
35 ) {
36 super()
37
38 this.titlePage = i18n('Recently added')
39 }
40
41 ngOnInit () {
42 super.ngOnInit()
43
44 this.generateSyndicationList()
45 }
46
47 ngOnDestroy () {
48 super.ngOnDestroy()
49 }
50
51 getVideosObservable (page: number) {
52 const newPagination = immutableAssign(this.pagination, { currentPage: page })
53 const params = {
54 videoPagination: newPagination,
55 sort: this.sort,
56 categoryOneOf: this.categoryOneOf,
57 languageOneOf: this.languageOneOf,
58 nsfwPolicy: this.nsfwPolicy,
59 skipCount: true
60 }
61
62 return this.hooks.wrapObsFun(
63 this.videoService.getVideos.bind(this.videoService),
64 params,
65 'common',
66 'filter:api.recently-added-videos.videos.list.params',
67 'filter:api.recently-added-videos.videos.list.result'
68 )
69 }
70
71 generateSyndicationList () {
72 this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf)
73 }
74}