aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-19 14:55:58 +0200
committerChocobozzz <me@florianbigard.com>2019-06-19 15:05:36 +0200
commit3caf77d3b11f2dbc12e52d665183d36604c1dab9 (patch)
tree53e08727d5f1dc8be2bd4f4a14dadc05f607a9fb /client/src/app/videos/video-list
parentbbe078ba55be635b5fc92f8f6286c45792b9e7e5 (diff)
downloadPeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.tar.gz
PeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.tar.zst
PeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.zip
Add language filters in user preferences
Diffstat (limited to 'client/src/app/videos/video-list')
-rw-r--r--client/src/app/videos/video-list/video-local.component.ts10
-rw-r--r--client/src/app/videos/video-list/video-recently-added.component.ts10
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts10
3 files changed, 27 insertions, 3 deletions
diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/videos/video-list/video-local.component.ts
index 65543343c..5de4a13af 100644
--- a/client/src/app/videos/video-list/video-local.component.ts
+++ b/client/src/app/videos/video-list/video-local.component.ts
@@ -21,6 +21,8 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On
21 sort = '-publishedAt' as VideoSortField 21 sort = '-publishedAt' as VideoSortField
22 filter: VideoFilter = 'local' 22 filter: VideoFilter = 'local'
23 23
24 useUserVideoLanguagePreferences = true
25
24 constructor ( 26 constructor (
25 protected i18n: I18n, 27 protected i18n: I18n,
26 protected router: Router, 28 protected router: Router,
@@ -54,7 +56,13 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On
54 getVideosObservable (page: number) { 56 getVideosObservable (page: number) {
55 const newPagination = immutableAssign(this.pagination, { currentPage: page }) 57 const newPagination = immutableAssign(this.pagination, { currentPage: page })
56 58
57 return this.videoService.getVideos(newPagination, this.sort, this.filter, this.categoryOneOf) 59 return this.videoService.getVideos({
60 videoPagination: newPagination,
61 sort: this.sort,
62 filter: this.filter,
63 categoryOneOf: this.categoryOneOf,
64 languageOneOf: this.languageOneOf
65 })
58 } 66 }
59 67
60 generateSyndicationList () { 68 generateSyndicationList () {
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
index f54bade98..19522e6b4 100644
--- a/client/src/app/videos/video-list/video-recently-added.component.ts
+++ b/client/src/app/videos/video-list/video-recently-added.component.ts
@@ -19,6 +19,8 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On
19 sort: VideoSortField = '-publishedAt' 19 sort: VideoSortField = '-publishedAt'
20 groupByDate = true 20 groupByDate = true
21 21
22 useUserVideoLanguagePreferences = true
23
22 constructor ( 24 constructor (
23 protected i18n: I18n, 25 protected i18n: I18n,
24 protected route: ActivatedRoute, 26 protected route: ActivatedRoute,
@@ -47,7 +49,13 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On
47 getVideosObservable (page: number) { 49 getVideosObservable (page: number) {
48 const newPagination = immutableAssign(this.pagination, { currentPage: page }) 50 const newPagination = immutableAssign(this.pagination, { currentPage: page })
49 51
50 return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf) 52 return this.videoService.getVideos({
53 videoPagination: newPagination,
54 sort: this.sort,
55 filter: undefined,
56 categoryOneOf: this.categoryOneOf,
57 languageOneOf: this.languageOneOf
58 })
51 } 59 }
52 60
53 generateSyndicationList () { 61 generateSyndicationList () {
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts
index a2c819ebe..5f1d5055b 100644
--- a/client/src/app/videos/video-list/video-trending.component.ts
+++ b/client/src/app/videos/video-list/video-trending.component.ts
@@ -18,6 +18,8 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
18 titlePage: string 18 titlePage: string
19 defaultSort: VideoSortField = '-trending' 19 defaultSort: VideoSortField = '-trending'
20 20
21 useUserVideoLanguagePreferences = true
22
21 constructor ( 23 constructor (
22 protected i18n: I18n, 24 protected i18n: I18n,
23 protected router: Router, 25 protected router: Router,
@@ -59,7 +61,13 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
59 61
60 getVideosObservable (page: number) { 62 getVideosObservable (page: number) {
61 const newPagination = immutableAssign(this.pagination, { currentPage: page }) 63 const newPagination = immutableAssign(this.pagination, { currentPage: page })
62 return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf) 64 return this.videoService.getVideos({
65 videoPagination: newPagination,
66 sort: this.sort,
67 filter: undefined,
68 categoryOneOf: this.categoryOneOf,
69 languageOneOf: this.languageOneOf
70 })
63 } 71 }
64 72
65 generateSyndicationList () { 73 generateSyndicationList () {