]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/video-list/trending/video-trending.component.ts
Merge branch 'develop' into shorter-URLs-channels-accounts
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / video-list / trending / video-trending.component.ts
index e50d6ec3a80aa1aff894a32afa92a1f995e4e33c..ebec672f3954465051609045b5ebb51afe07b09c 100644 (file)
@@ -35,11 +35,12 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
     protected storageService: LocalStorageService,
     protected cfr: ComponentFactoryResolver,
     private videoService: VideoService,
+    private redirectService: RedirectService,
     private hooks: HooksService
   ) {
     super()
 
-    this.defaultSort = this.parseAlgorithm(RedirectService.DEFAULT_TRENDING_ALGORITHM)
+    this.defaultSort = this.parseAlgorithm(this.redirectService.getDefaultTrendingAlgorithm())
 
     this.headerComponentInjector = this.getInjector()
   }
@@ -106,7 +107,7 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
   }
 
   protected loadPageRouteParams (queryParams: Params) {
-    const algorithm = queryParams['alg'] || RedirectService.DEFAULT_TRENDING_ALGORITHM
+    const algorithm = queryParams['alg'] || this.redirectService.getDefaultTrendingAlgorithm()
 
     this.sort = this.parseAlgorithm(algorithm)
   }
@@ -115,8 +116,10 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
     switch (algorithm) {
       case 'most-viewed':
         return '-trending'
+
       case 'most-liked':
         return '-likes'
+
       default:
         return '-' + algorithm as VideoSortField
     }