getSyndicationItems (filters: VideoFilters) {
const result = filters.toVideosAPIObject()
- return this.videoService.getVideoFeedUrls(result.sort, result.filter)
+ return this.videoService.getVideoFeedUrls(result.sort, result.isLocal)
}
onFiltersChanged (filters: VideoFilters) {
case 'most-liked':
return '-likes'
+ // We'll automatically apply "best" sort if using "hot" sort with a logged user
+ case 'best':
+ return '-hot'
+
+ case 'name':
+ return 'name'
+
default:
return '-' + algorithm as VideoSortField
}
return
}
- if ([ 'best', 'hot', 'trending', 'likes' ].includes(sanitizedSort)) {
+ if ([ 'hot', 'trending', 'likes', 'views' ].includes(sanitizedSort)) {
this.title = $localize`Trending`
- if (sanitizedSort === 'best') this.titleTooltip = $localize`Videos with the most interactions for recent videos, minus user history`
- 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 === 'hot') {
+ this.titleTooltip = $localize`Videos with the most interactions for recent videos`
+ return
+ }
+
+ if (sanitizedSort === 'likes') {
+ this.titleTooltip = $localize`Videos that have the most likes`
+ return
+ }
+
+ if (sanitizedSort === 'views') {
+ this.titleTooltip = undefined
+ return
+ }
if (sanitizedSort === 'trending') {
- if (this.trendingDays === 1) this.titleTooltip = $localize`Videos with the most views during the last 24 hours`
- else this.titleTooltip = $localize`Videos with the most views during the last ${this.trendingDays} days`
+ if (this.trendingDays === 1) {
+ this.titleTooltip = $localize`Videos with the most views during the last 24 hours`
+ return
+ }
+
+ this.titleTooltip = $localize`Videos with the most views during the last ${this.trendingDays} days`
}
return