2727
2828 <FtFlexBox class =" radioFlexBox" >
2929 <FtRadioButton
30- v-model =" sortByValue "
31- :title =" $t('Global.Sort By ')"
32- :labels =" sortByLabels "
33- :values =" SORT_BY_VALUES "
30+ v-model =" prioritizeValue "
31+ :title =" $t('Search Filters.Prioritize.Prioritize ')"
32+ :labels =" prioritizeLabels "
33+ :values =" PRIORITIZE_VALUES "
3434 class =" searchRadio"
3535 />
3636 <FtRadioButton
@@ -87,16 +87,13 @@ import store from '../../store/index'
8787
8888const { t } = useI18n ()
8989
90- const SORT_BY_VALUES = [
90+ const PRIORITIZE_VALUES = [
9191 ' relevance' ,
92- ' rating' ,
93- ' upload_date' ,
94- ' view_count'
92+ ' popularity'
9593]
9694
9795const TIME_VALUES = [
9896 ' ' ,
99- ' hour' ,
10097 ' today' ,
10198 ' week' ,
10299 ' month' ,
@@ -106,16 +103,17 @@ const TIME_VALUES = [
106103const TYPE_VALUES = [
107104 ' all' ,
108105 ' video' ,
106+ ' shorts' ,
109107 ' channel' ,
110108 ' playlist' ,
111109 ' movie'
112110]
113111
114112const DURATION_VALUES = [
115113 ' ' ,
116- ' short ' ,
117- ' medium ' ,
118- ' long '
114+ ' under_three_mins ' ,
115+ ' three_to_twenty_mins ' ,
116+ ' over_twenty_mins '
119117]
120118
121119const FEATURE_VALUES = [
@@ -140,16 +138,13 @@ const NOT_ALLOWED_FOR_MOVIES_FEATURES = [
140138
141139const title = computed (() => t (' Search Filters.Search Filters' ))
142140
143- const sortByLabels = computed (() => [
144- t (' Search Filters.Sort By.Most Relevant' ),
145- t (' Search Filters.Sort By.Rating' ),
146- t (' Search Filters.Sort By.Upload Date' ),
147- t (' Search Filters.Sort By.View Count' )
141+ const prioritizeLabels = computed (() => [
142+ t (' Search Filters.Prioritize.Most Relevant' ),
143+ t (' Search Filters.Prioritize.Popularity' )
148144])
149145
150146const timeLabels = computed (() => [
151147 t (' Search Filters.Time.Any Time' ),
152- t (' Search Filters.Time.Last Hour' ),
153148 t (' Search Filters.Time.Today' ),
154149 t (' Search Filters.Time.This Week' ),
155150 t (' Search Filters.Time.This Month' ),
@@ -159,16 +154,17 @@ const timeLabels = computed(() => [
159154const typeLabels = computed (() => [
160155 t (' Search Filters.Type.All Types' ),
161156 t (' Search Filters.Type.Videos' ),
157+ t (' Global.Shorts' ),
162158 t (' Search Filters.Type.Channels' ),
163159 t (' Playlists' ),
164160 t (' Search Filters.Type.Movies' )
165161])
166162
167163const durationLabels = computed (() => [
168164 t (' Search Filters.Duration.All Durations' ),
169- t (' Search Filters.Duration.Short (< 4 minutes) ' ),
170- t (' Search Filters.Duration.Medium (4 - 20 minutes) ' ),
171- t (' Search Filters.Duration.Long ( > 20 minutes) ' )
165+ t (' Search Filters.Duration.< 3 minutes' ),
166+ t (' Search Filters.Duration.3 - 20 minutes' ),
167+ t (' Search Filters.Duration.> 20 minutes' )
172168])
173169
174170const featureLabels = computed (() => [
@@ -186,14 +182,18 @@ const featureLabels = computed(() => [
186182
187183const searchSettings = store .getters .getSearchSettings
188184
189- /** @type {import('vue').Ref<'relevance' | 'rating' | 'upload_date' | 'view_count '>} */
190- const sortByValue = ref (searchSettings .sortBy )
185+ /** @type {import('vue').Ref<'relevance' | 'popularity '>} */
186+ const prioritizeValue = ref (searchSettings .prioritize )
191187
192- watch (sortByValue, (value ) => {
193- store .commit (' setSearchSortBy' , value)
188+ watch (prioritizeValue, (value ) => {
189+ if (value === ' popularity' && (typeValue .value === ' channel' || typeValue .value === ' playlist' )) {
190+ typeValue .value = ' all'
191+ }
192+
193+ store .commit (' setSearchPrioritize' , value)
194194})
195195
196- /** @type {import('vue').Ref<'' | 'hour' | ' today' | 'week' | 'month' | 'year'>} */
196+ /** @type {import('vue').Ref<'' | 'today' | 'week' | 'month' | 'year'>} */
197197const timeValue = ref (searchSettings .time )
198198
199199watch (timeValue, (value ) => {
@@ -204,14 +204,16 @@ watch(timeValue, (value) => {
204204 store .commit (' setSearchTime' , value)
205205})
206206
207- /** @type {import('vue').Ref<'all' | 'video' | 'channel' | 'playlist' | 'movie'>} */
207+ /** @type {import('vue').Ref<'all' | 'video' | 'shorts' | ' channel' | 'playlist' | 'movie'>} */
208208const typeValue = ref (searchSettings .type )
209209
210210watch (typeValue, (value ) => {
211- if (value === ' channel' || value === ' playlist' ) {
211+ if (value === ' shorts' ) {
212+ durationValue .value = ' '
213+ } else if (value === ' channel' || value === ' playlist' ) {
212214 timeValue .value = ' '
213215 durationValue .value = ' '
214- sortByValue .value = SORT_BY_VALUES [0 ]
216+ prioritizeValue .value = PRIORITIZE_VALUES [0 ]
215217 if (featuresValue .value .length > 0 ) {
216218 featuresValue .value = []
217219 }
@@ -224,7 +226,7 @@ watch(typeValue, (value) => {
224226 store .commit (' setSearchType' , value)
225227})
226228
227- /** @type {import('vue').Ref<'' | 'short ' | 'medium ' | 'long '>} */
229+ /** @type {import('vue').Ref<'' | 'under_three_mins ' | 'three_to_twenty_mins ' | 'over_twenty_mins '>} */
228230const durationValue = ref (searchSettings .duration )
229231
230232watch (durationValue, (value ) => {
@@ -247,7 +249,7 @@ watch(featuresValue, (values) => {
247249}, { deep: true })
248250
249251const searchFilterValueChanged = computed (() => {
250- return sortByValue .value !== SORT_BY_VALUES [0 ] ||
252+ return prioritizeValue .value !== PRIORITIZE_VALUES [0 ] ||
251253 timeValue .value !== TIME_VALUES [0 ] ||
252254 typeValue .value !== TYPE_VALUES [0 ] ||
253255 durationValue .value !== DURATION_VALUES [0 ] ||
@@ -270,7 +272,7 @@ function isVideoOrMovieOrAll(type) {
270272}
271273
272274function clearFilters () {
273- sortByValue .value = SORT_BY_VALUES [0 ]
275+ prioritizeValue .value = PRIORITIZE_VALUES [0 ]
274276 timeValue .value = TIME_VALUES [0 ]
275277 typeValue .value = TYPE_VALUES [0 ]
276278 durationValue .value = DURATION_VALUES [0 ]
0 commit comments