Skip to content

Commit

Permalink
Add back sort by oldest (FreeTubeApp#3698)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Jun 27, 2023
1 parent 6e0395d commit 7c7e0e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
23 changes: 18 additions & 5 deletions src/renderer/views/Channel/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ export default defineComponent({
errorMessage: '',
showSearchBar: true,
showShareMenu: true,
videoShortLiveSelectValues: [
videoLiveSelectValues: [
'newest',
'popular',
'oldest'
],
shortSelectValues: [
'newest',
'popular'
],
Expand Down Expand Up @@ -137,7 +142,15 @@ export default defineComponent({
return this.subscriptionInfo !== null
},

videoShortLiveSelectNames: function () {
videoLiveSelectNames: function () {
return [
this.$t('Channel.Videos.Sort Types.Newest'),
this.$t('Channel.Videos.Sort Types.Most Popular'),
this.$t('Channel.Videos.Sort Types.Oldest')
]
},

shortSelectNames: function () {
return [
this.$t('Channel.Videos.Sort Types.Newest'),
this.$t('Channel.Videos.Sort Types.Most Popular')
Expand Down Expand Up @@ -687,7 +700,7 @@ export default defineComponent({
this.showVideoSortBy = videosTab.filters.length > 1

if (this.showVideoSortBy && this.videoSortBy !== 'newest') {
const index = this.videoShortLiveSelectValues.indexOf(this.videoSortBy)
const index = this.videoLiveSelectValues.indexOf(this.videoSortBy)
videosTab = await videosTab.applyFilter(videosTab.filters[index])
}

Expand Down Expand Up @@ -745,7 +758,7 @@ export default defineComponent({
this.showShortSortBy = shortsTab.filters.length > 1

if (this.showShortSortBy && this.shortSortBy !== 'newest') {
const index = this.videoShortLiveSelectValues.indexOf(this.shortSortBy)
const index = this.shortSelectValues.indexOf(this.shortSortBy)
shortsTab = await shortsTab.applyFilter(shortsTab.filters[index])
}

Expand Down Expand Up @@ -803,7 +816,7 @@ export default defineComponent({
this.showLiveSortBy = liveTab.filters.length > 1

if (this.showLiveSortBy && this.liveSortBy !== 'newest') {
const index = this.videoShortLiveSelectValues.indexOf(this.liveSortBy)
const index = this.videoLiveSelectValues.indexOf(this.liveSortBy)
liveTab = await liveTab.applyFilter(liveTab.filters[index])
}

Expand Down
18 changes: 9 additions & 9 deletions src/renderer/views/Channel/Channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,29 @@
v-if="showVideoSortBy"
v-show="currentTab === 'videos' && latestVideos.length > 0"
class="sortSelect"
:value="videoShortLiveSelectValues[0]"
:select-names="videoShortLiveSelectNames"
:select-values="videoShortLiveSelectValues"
:value="videoLiveSelectValues[0]"
:select-names="videoLiveSelectNames"
:select-values="videoLiveSelectValues"
:placeholder="$t('Search Filters.Sort By.Sort By')"
@change="videoSortBy = $event"
/>
<ft-select
v-if="!hideChannelShorts && showShortSortBy"
v-show="currentTab === 'shorts' && latestShorts.length > 0"
class="sortSelect"
:value="videoShortLiveSelectValues[0]"
:select-names="videoShortLiveSelectNames"
:select-values="videoShortLiveSelectValues"
:value="shortSelectValues[0]"
:select-names="shortSelectNames"
:select-values="shortSelectValues"
:placeholder="$t('Search Filters.Sort By.Sort By')"
@change="shortSortBy = $event"
/>
<ft-select
v-if="!hideLiveStreams && showLiveSortBy"
v-show="currentTab === 'live' && latestLive.length > 0"
class="sortSelect"
:value="videoShortLiveSelectValues[0]"
:select-names="videoShortLiveSelectNames"
:select-values="videoShortLiveSelectValues"
:value="videoLiveSelectValues[0]"
:select-names="videoLiveSelectNames"
:select-values="videoLiveSelectValues"
:placeholder="$t('Search Filters.Sort By.Sort By')"
@change="liveSortBy = $event"
/>
Expand Down

0 comments on commit 7c7e0e5

Please sign in to comment.