Fix search sort filters (#338)
This commit is contained in:
1 parent
862fea74e7
commit
3391e3d787
6 files changed
+20
-22
No files matched your search
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- A bug where instance testing is not immediately cancelled when the testing page is closed
|
||||
- A bug in the web app where "upcoming" videos show up as "live"
|
||||
- Search sort filters
|
||||
|
||||
## [0.21.2] - 2024-03-10
|
||||
|
||||
|
||||
@@ -87,15 +87,15 @@ function Init()
|
||||
title: Tr(Locale.SearchFilters.Location)
|
||||
value: "location"
|
||||
}]
|
||||
sort_by: [{
|
||||
sort: [{
|
||||
title: Tr(Locale.SearchFilters.Relevance)
|
||||
value: ""
|
||||
}, {
|
||||
title: Tr(Locale.SearchFilters.UploadDate)
|
||||
value: "upload_date"
|
||||
value: "date"
|
||||
}, {
|
||||
title: Tr(Locale.SearchFilters.ViewCount)
|
||||
value: "view_count"
|
||||
value: "views"
|
||||
}, {
|
||||
title: Tr(Locale.SearchFilters.Rating)
|
||||
value: "rating"
|
||||
@@ -107,7 +107,7 @@ function Init()
|
||||
type: m.top.findNode("TypeList")
|
||||
duration: m.top.findNode("DurationList")
|
||||
features: m.top.findNode("FeaturesList")
|
||||
sort_by: m.top.findNode("SortByList")
|
||||
sort: m.top.findNode("SortList")
|
||||
}
|
||||
|
||||
for each filterKey in m.controls
|
||||
@@ -120,12 +120,12 @@ function Init()
|
||||
type: m.controls.type.content
|
||||
duration: m.controls.duration.content
|
||||
features: m.controls.features.content
|
||||
sort_by: m.controls.sort_by.content
|
||||
sort: m.controls.sort.content
|
||||
}
|
||||
|
||||
PopulateLists(m.contentNodes, options)
|
||||
|
||||
navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort_by]
|
||||
navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort]
|
||||
for i = 0 to navigationNodes.count() - 2
|
||||
SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1])
|
||||
end for
|
||||
@@ -154,7 +154,7 @@ function OnNodeReady()
|
||||
m.controls.type.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.duration.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.features.ObserveField("checkedState", FuncName(OnListChecked))
|
||||
m.controls.sort_by.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.sort.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
end function
|
||||
|
||||
function RefreshUI()
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
width="180"
|
||||
height="1" />
|
||||
<RadioButtonList
|
||||
id="SortByList"
|
||||
id="SortList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
|
||||
@@ -34,7 +34,7 @@ function Init()
|
||||
type: ""
|
||||
duration: ""
|
||||
features: []
|
||||
sort_by: ""
|
||||
sort: ""
|
||||
}
|
||||
|
||||
m.top.ObserveField("filters", FuncName(OnFiltersChange))
|
||||
|
||||
@@ -23,12 +23,12 @@ search:
|
||||
queryParams:
|
||||
q:
|
||||
type: string
|
||||
sort_by:
|
||||
sort:
|
||||
type:
|
||||
- relevance
|
||||
- rating
|
||||
- upload_date
|
||||
- view_count
|
||||
- date
|
||||
- views
|
||||
date:
|
||||
type:
|
||||
- hour
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
type: "",
|
||||
duration: "",
|
||||
features: [],
|
||||
sort_by: "",
|
||||
sort: "",
|
||||
};
|
||||
|
||||
let features_kv: any = {};
|
||||
@@ -28,7 +28,7 @@
|
||||
count += filters.type ? 1 : 0;
|
||||
count += filters.duration ? 1 : 0;
|
||||
count += filters.features.length;
|
||||
count += filters.sort_by ? 1 : 0;
|
||||
count += filters.sort ? 1 : 0;
|
||||
|
||||
label = $tr("Filters") + `${count > 0 ? ` (${count})` : ""}`;
|
||||
}
|
||||
@@ -146,18 +146,18 @@
|
||||
value: "location",
|
||||
},
|
||||
],
|
||||
sort_by: [
|
||||
sort: [
|
||||
{
|
||||
title: "Relevance",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
title: "Upload date",
|
||||
value: "upload_date",
|
||||
value: "date",
|
||||
},
|
||||
{
|
||||
title: "View count",
|
||||
value: "view_count",
|
||||
value: "views",
|
||||
},
|
||||
{
|
||||
title: "Rating",
|
||||
@@ -223,11 +223,8 @@
|
||||
|
||||
<div class="mb-4">
|
||||
<h3 class="text-lg font-bold mb-2">{$tr("Sort by")}</h3>
|
||||
<select
|
||||
class="input input-bordered w-full"
|
||||
bind:value={filters.sort_by}
|
||||
>
|
||||
{#each options.sort_by as { title, value }}
|
||||
<select class="input input-bordered w-full" bind:value={filters.sort}>
|
||||
{#each options.sort as { title, value }}
|
||||
<option {value}>{$tr(title)}</option>
|
||||
{/each}
|
||||
</select>
|
||||
|
||||
Reference in new issue
Block a user