aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-04-15 15:07:20 +0200
committerChocobozzz <me@florianbigard.com>2022-04-15 15:07:20 +0200
commit2b0d17ccf46cfdba4103b7287f0dadf289ad4faf (patch)
tree3b006eff6a32126d8c260f99f561e2ac1901e4d1 /client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
parentd09ed46e71b78b4874de4afabefa2f9453c5894d (diff)
downloadPeerTube-2b0d17ccf46cfdba4103b7287f0dadf289ad4faf.tar.gz
PeerTube-2b0d17ccf46cfdba4103b7287f0dadf289ad4faf.tar.zst
PeerTube-2b0d17ccf46cfdba4103b7287f0dadf289ad4faf.zip
Reduce videos sort complexity
Automatically use best sort if user is logged in and chose hot algorithm
Diffstat (limited to 'client/src/app/shared/shared-video-miniature/video-filters-header.component.ts')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-filters-header.component.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
index 2c52e43f7..7b806248b 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
@@ -72,15 +72,10 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
72 return this.auth.getUser().hasRight(UserRight.SEE_ALL_VIDEOS) 72 return this.auth.getUser().hasRight(UserRight.SEE_ALL_VIDEOS)
73 } 73 }
74 74
75 isTrendingSortEnabled (sort: 'most-viewed' | 'hot' | 'best' | 'most-liked') { 75 isTrendingSortEnabled (sort: 'most-viewed' | 'hot' | 'most-liked') {
76 const serverConfig = this.serverService.getHTMLConfig() 76 const serverConfig = this.serverService.getHTMLConfig()
77 77
78 const enabled = serverConfig.trending.videos.algorithms.enabled.includes(sort) 78 return serverConfig.trending.videos.algorithms.enabled.includes(sort)
79
80 // Best is adapted from the user
81 if (sort === 'best') return enabled && this.auth.isLoggedIn()
82
83 return enabled
84 } 79 }
85 80
86 resetFilter (key: string, canRemove: boolean) { 81 resetFilter (key: string, canRemove: boolean) {