]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add ability to sort by global views
authorChocobozzz <me@florianbigard.com>
Fri, 15 Apr 2022 13:14:32 +0000 (15:14 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 15 Apr 2022 13:14:32 +0000 (15:14 +0200)
client/src/app/+videos/video-list/videos-list-common-page.component.ts
client/src/app/shared/shared-video-miniature/video-filters-header.component.html

index 32737ef1c0689c98b4b5b7f2f7026f3cd0fdbdf1..72c7e1ef69f9c9929ccaea703ff78c548d66dfed 100644 (file)
@@ -197,11 +197,12 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
       return
     }
 
-    if ([ 'hot', 'trending', 'likes' ].includes(sanitizedSort)) {
+    if ([ 'hot', 'trending', 'likes', 'views' ].includes(sanitizedSort)) {
       this.title = $localize`Trending`
 
       if (sanitizedSort === 'hot') this.titleTooltip = $localize`Videos with the most interactions for recent videos`
       if (sanitizedSort === 'likes') this.titleTooltip = $localize`Videos that have the most likes`
+      if (sanitizedSort === 'views') this.titleTooltip = undefined
 
       if (sanitizedSort === 'trending') {
         if (this.trendingDays === 1) this.titleTooltip = $localize`Videos with the most views during the last 24 hours`
index fc34b1b29783514632da55132aecff6f7e76b8e1..a07b8b5eed704349cb55a4fea2fe523f33d26beb 100644 (file)
@@ -48,6 +48,7 @@
       <ng-option i18n *ngIf="isTrendingSortEnabled('most-viewed')" value="-trending">Sort by <strong>"Recent Views"</strong></ng-option>
       <ng-option i18n *ngIf="isTrendingSortEnabled('hot')" value="-hot">Sort by <strong>"Hot"</strong></ng-option>
       <ng-option i18n *ngIf="isTrendingSortEnabled('most-liked')" value="-likes">Sort by <strong>"Likes"</strong></ng-option>
+      <ng-option i18n value="-views">Sort by <strong>"Global Views"</strong></ng-option>
     </ng-select>
 
   </div>